Skip to content

Commit

Permalink
fix(delete range): maintain unused iters in seek (close risingwavel…
Browse files Browse the repository at this point in the history
  • Loading branch information
soundOfDestiny committed Apr 3, 2023
1 parent 6f46e4c commit 37ce407
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/storage/src/hummock/iterator/delete_range_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,13 @@ impl DeleteRangeIterator for ForwardMergeRangeIterator {

fn seek<'a>(&'a mut self, target_user_key: UserKey<&'a [u8]>) {
self.unused_iters.extend(self.heap.drain());
for mut node in self.unused_iters.drain(..) {
node.seek(target_user_key);
if node.is_valid() {
self.heap.push(node);
}
}
self.heap = self
.unused_iters
.drain_filter(|node| {
node.seek(target_user_key);
node.is_valid()
})
.collect();
}

fn is_valid(&self) -> bool {
Expand Down

0 comments on commit 37ce407

Please sign in to comment.