fix: avoid leveled compaction crash when recovering from manifest (#63)

* Fix: Avoid leveled copaction crash when recovering from manifest

* Also sort SSTs in manifest recovery

* Add `in_recovery` flag to `apply_compaction_result`

- Don't sort the SSTs inside `apply_compaction_result` if in recovery
This commit is contained in:
Eikasia30
2024-07-02 20:25:43 -04:00
committed by GitHub
parent 2b527fd6dc
commit 77e15efad4
10 changed files with 141 additions and 27 deletions

View File

@@ -561,8 +561,12 @@ fn main() {
.join(", ")
);
max_space = max_space.max(storage.file_list.len());
let (snapshot, del) =
controller.apply_compaction_result(&storage.snapshot, &task, &sst_ids);
let (snapshot, del) = controller.apply_compaction_result(
&storage.snapshot,
&task,
&sst_ids,
false,
);
storage.snapshot = snapshot;
storage.remove(&del);
println!("--- After Compaction ---");