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.
This commit is contained in:
Ignotus Peverell
2017-11-25 23:26:36 -05:00
parent 0fb15641fe
commit 2c6c8ed688
+3 -1
View File
@@ -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()
}