aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-09-06 16:34:07 +0200
committerAlex Auvolat <alex@adnab.me>2023-09-06 16:34:07 +0200
commit4b4f2000f45a83b4dad3f2a8fd8392a245a30286 (patch)
tree3ba6cbb33839ceb06e07518e776b612d1101f651 /src/model
parent3f461d889143c5f6edf64ff9649647d944a2ab17 (diff)
downloadgarage-4b4f2000f45a83b4dad3f2a8fd8392a245a30286.tar.gz
garage-4b4f2000f45a83b4dad3f2a8fd8392a245a30286.zip
lifecycle: fix SkipBucket bug
Diffstat (limited to 'src/model')
-rw-r--r--src/model/s3/lifecycle_worker.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/model/s3/lifecycle_worker.rs b/src/model/s3/lifecycle_worker.rs
index 4734742d..42e661eb 100644
--- a/src/model/s3/lifecycle_worker.rs
+++ b/src/model/s3/lifecycle_worker.rs
@@ -192,11 +192,12 @@ impl Worker for LifecycleWorker {
*counter += 1;
if skip == Skip::SkipBucket {
let bucket_id_len = object.bucket_id.as_slice().len();
- assert_eq!(pos.get(..bucket_id_len), Some(object.bucket_id.as_slice()));
- *pos = std::cmp::max(
- next_pos,
- [&pos[..bucket_id_len], &[0xFFu8][..]].concat(),
+ assert_eq!(
+ next_pos.get(..bucket_id_len),
+ Some(object.bucket_id.as_slice())
);
+ let last_bucket_pos = [&next_pos[..bucket_id_len], &[0xFFu8][..]].concat();
+ *pos = std::cmp::max(next_pos, last_bucket_pos);
} else {
*pos = next_pos;
}