ensure compaction can finish in mvcc

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-25 23:45:00 +08:00
parent 63429b50d5
commit 595016f2b6
3 changed files with 8 additions and 8 deletions

View File

@@ -307,7 +307,6 @@ impl LsmStorageInner {
}
fn trigger_compaction(&self) -> Result<()> {
self.dump_structure();
let snapshot = {
let state = self.state.read();
state.clone()
@@ -318,6 +317,7 @@ impl LsmStorageInner {
let Some(task) = task else {
return Ok(());
};
self.dump_structure();
println!("running compaction task: {:?}", task);
let sstables = self.compact(&task)?;
let output = sstables.iter().map(|x| x.sst_id()).collect::<Vec<_>>();