forked from Deuxfleurs/garage
lifecycle: fix SkipBucket bug
This commit is contained in:
parent
3f461d8891
commit
4b4f2000f4
1 changed files with 5 additions and 4 deletions
|
@ -192,11 +192,12 @@ impl Worker for LifecycleWorker {
|
||||||
*counter += 1;
|
*counter += 1;
|
||||||
if skip == Skip::SkipBucket {
|
if skip == Skip::SkipBucket {
|
||||||
let bucket_id_len = object.bucket_id.as_slice().len();
|
let bucket_id_len = object.bucket_id.as_slice().len();
|
||||||
assert_eq!(pos.get(..bucket_id_len), Some(object.bucket_id.as_slice()));
|
assert_eq!(
|
||||||
*pos = std::cmp::max(
|
next_pos.get(..bucket_id_len),
|
||||||
next_pos,
|
Some(object.bucket_id.as_slice())
|
||||||
[&pos[..bucket_id_len], &[0xFFu8][..]].concat(),
|
|
||||||
);
|
);
|
||||||
|
let last_bucket_pos = [&next_pos[..bucket_id_len], &[0xFFu8][..]].concat();
|
||||||
|
*pos = std::cmp::max(next_pos, last_bucket_pos);
|
||||||
} else {
|
} else {
|
||||||
*pos = next_pos;
|
*pos = next_pos;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue