fix read path after compaction

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-19 16:10:18 +08:00
parent beb3feabf9
commit 13ae8fe8fb
10 changed files with 143 additions and 41 deletions

17
mini-lsm/src/debug.rs Normal file
View File

@@ -0,0 +1,17 @@
use crate::lsm_storage::MiniLsm;
impl MiniLsm {
pub fn dump_structure(&self) {
let snapshot = self.inner.state.read();
if !snapshot.l0_sstables.is_empty() {
println!(
"L0 ({}): {:?}",
snapshot.l0_sstables.len(),
snapshot.l0_sstables,
);
}
for (level, files) in &snapshot.levels {
println!("L{level} ({}): {:?}", files.len(), files);
}
}
}