Skip to content

Commit

Permalink
disk idx: apply_grow_index does not delete index file (#33384)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Sep 24, 2023
1 parent 5c57641 commit 27f59e8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bucket_map/src/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,20 @@ impl<'b, T: Clone + Copy + PartialEq + std::fmt::Debug + 'static> Bucket<T> {
}
}

pub fn apply_grow_index(&mut self, index: BucketStorage<IndexBucket<T>>) {
pub fn apply_grow_index(&mut self, mut index: BucketStorage<IndexBucket<T>>) {
self.stats
.index
.resize_grow(self.index.capacity_bytes(), index.capacity_bytes());

if self.restartable_bucket.restart.is_some() {
// we are keeping track of which files we use for restart.
// And we are resizing.
// So, delete the old file and set the new file to NOT delete.
// This way the new file will still be around on startup.
// We are completely done with the old file.
self.index.delete_file_on_drop = true;
index.delete_file_on_drop = false;
}
self.index = index;
}

Expand Down

0 comments on commit 27f59e8

Please sign in to comment.