aboutsummaryrefslogtreecommitdiffstats
path: root/log_db/src
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-01-10 22:25:01 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-01-10 23:32:38 +0200
commit899927cf6e517690622cb6cab40d15f19bd229cb (patch)
tree6eb1764ed0c383f132d142c13f51fc3371e44a7f /log_db/src
parent07c593d9b836232c2d9bbe986baaa3099edddbb4 (diff)
Fix delete compact bug
Diffstat (limited to 'log_db/src')
-rw-r--r--log_db/src/lib.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/log_db/src/lib.rs b/log_db/src/lib.rs
index 918f5e1..928da8d 100644
--- a/log_db/src/lib.rs
+++ b/log_db/src/lib.rs
@@ -813,7 +813,7 @@ impl<R: Recordable> DB<R> {
let active_num = parse_segment_number(&active_target)?;
debug!("Reading segment data into a BTreeMap");
- let mut pk_to_item_map = BTreeMap::new();
+ let mut pk_to_item_map: BTreeMap<&IndexableValue, &Record> = BTreeMap::new();
let forward_read_items: Vec<(IndexableValue, Record)> = ForwardLogReader::new(
self.active_metadata_file.try_clone()?,
self.active_data_file.try_clone()?,
@@ -832,12 +832,7 @@ impl<R: Recordable> DB<R> {
self.active_data_file.unlock()?;
for (pk, record) in forward_read_items.iter() {
- // If the record is a tombstone, remove the PK from the map
- if record.tombstone {
- pk_to_item_map.remove(pk);
- } else {
- pk_to_item_map.insert(pk, record);
- }
+ pk_to_item_map.insert(pk, record);
}
debug!(