You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#14
This was an unfortunate oversight. This edge case only occurs when the
first entry of a new log file is rolled back.
The code that was designed to re-write the file header when reverting to
length 0 was slightly wrong. The file header was being written at the
location of the rolled back entry due to checking if the fsynced length
was 0 rather than if the newly set length was 0. Since the file never
had a commit() success, synchronized_length was 0 but length was 5.
The fix is to check if length is 0 instead before rewriting the header.
The test case from #14 has been added as a new unit test.
The release is out, and I've yanked all previous versions on crates.io due to the risk of data loss. Thank you again for reporting this and providing such a simple test case.
If the first entry is rolled back,
LogManager::recover()
is never called for the entire WAL.To reproduce:
This prints nothing. If the first
log.begin_entry()
is commented out,recover()
is called correctly.The text was updated successfully, but these errors were encountered: