Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
14 changes: 13 additions & 1 deletion src/abstract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ pub trait AbstractTree {
);
let stream = CompactionStream::new(merger, seqno_threshold);

// Collect range tombstones from sealed memtables
let mut range_tombstones = Vec::new();
for mt in latest.sealed_memtables.iter() {
range_tombstones.extend(mt.range_tombstones_by_start());
}

drop(version_history);

if let Some((tables, blob_files)) = self.flush_to_tables(stream)? {
if let Some((tables, blob_files)) = self.flush_to_tables(stream, range_tombstones)? {
self.register_tables(
&tables,
blob_files.as_deref(),
Expand Down Expand Up @@ -216,6 +222,7 @@ pub trait AbstractTree {
fn flush_to_tables(
&self,
stream: impl Iterator<Item = crate::Result<InternalValue>>,
range_tombstones: Vec<crate::range_tombstone::RangeTombstone>,
) -> crate::Result<Option<FlushToTablesResult>>;

/// Atomically registers flushed tables into the tree, removing their associated sealed memtables.
Expand Down Expand Up @@ -598,4 +605,9 @@ pub trait AbstractTree {
/// Will return `Err` if an IO error occurs.
#[doc(hidden)]
fn remove_weak<K: Into<UserKey>>(&self, key: K, seqno: SeqNo) -> (u64, u64);

/// Inserts a range tombstone that suppresses all keys in `[start, end)` with
/// sequence numbers strictly less than `seqno`.
#[doc(hidden)]
fn remove_range<K: AsRef<[u8]>>(&self, start: K, end: K, seqno: SeqNo);
}
Loading