Fix rm log not getting written to disk
Only the temporary remove log for the last block was written to
disk, and then overwritten for every block. The fix writes the
temp remove log (just last block) to the permanent remove log,
and saves that to disk.
@@ -215,11 +215,13 @@ impl RemoveLog {
match self.removed.binary_search(&elmt) {
Ok(_) => continue,
Err(idx) => {
- file.write_all(&ser::ser_vec(&elmt).unwrap()[..])?;
self.removed.insert(idx, *elmt);
}
}
}
+ for elmt in &self.removed {
+ file.write_all(&ser::ser_vec(&elmt).unwrap()[..])?;
+ }
self.removed_tmp = vec![];
file.sync_data()
}
