Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions storage/src/ordinal/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,17 @@ impl<E: BufferPooler + Context, V: CodecFixed<Cfg = ()>> Ordinal<E, V> {
for section in sections_to_remove {
if let Some(blob) = self.blobs.remove(&section) {
drop(blob);
self.context
.remove(&self.config.partition, Some(&section.to_be_bytes()))
.await?;

// Remove the corresponding index range from intervals
// Remove from intervals before attempting disk removal so that
// if context.remove fails, blobs and intervals remain consistent.
let start_index = section * items_per_blob;
let end_index = (section + 1) * items_per_blob - 1;
self.intervals.remove(start_index, end_index);

self.context
.remove(&self.config.partition, Some(&section.to_be_bytes()))
.await?;

debug!(section, start_index, end_index, "pruned blob");
}

Expand Down