streambed / streambed-rs

Event driven services toolkit
Apache License 2.0
31 stars 5 forks source link

Recover compaction #41

Closed huntc closed 1 year ago

huntc commented 1 year ago

If compaction had not finished when it was stopped, then restore things to a state where compaction may begin again. This may help avoid any weird corruption due to moving files between stopping and starting. I tested this against a corrupt history file and it worked well and seems like a reasonable thing to do no matter what.

Fixes #40 - note that we don't attempt to fix reading a corrupt write in general though - all bets are off in this scenario, and a hard reset may be required. I'm unsure how a corrupt write can occur with a journaled file system.

huntc commented 1 year ago

Self merging so that I can do some releasing.