check compaction converge for simple leveled

Signed-off-by: Alex Chi Z <iskyzh@gmail.com>
This commit is contained in:
Alex Chi Z
2024-01-17 16:23:58 +08:00
parent 6649111660
commit e622bee18a
6 changed files with 15 additions and 7 deletions

View File

@@ -160,7 +160,6 @@ fn main() {
}
let mut num_compactions = 0;
while let Some(task) = controller.generate_compaction_task(&storage.snapshot) {
num_compactions += 1;
println!("--- Compaction Task ---");
let mut sst_ids = Vec::new();
for file in task
@@ -194,6 +193,10 @@ fn main() {
} else {
storage.dump_original_id(true);
}
num_compactions += 1;
if num_compactions >= max_levels * 2 {
panic!("compaction does not converge?");
}
}
if num_compactions == 0 {
println!("no compaction triggered");