Repository navigation
Refuse data log reads and appends after a swap that can't recover - #180
Merged
Merged
Conversation
When compaction's rename fails and the old log can't be reopened, the log is marked lost, as the journal already does. Appends no longer go to the removed file, and reads no longer use the old generation's offsets. Fixes #150
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When compaction's rename fails and reopening the old log fails too, the data log kept a handle to the file it had just removed. Appends went there and were lost at the next restart. Reads looked up old offsets in the wrong file.
Now that branch marks the log lost, as the journal already does. Reads, appends, record checks and compaction are refused with an error that says to open the store again. serve-s3's reclaim pass already logs the error.
Tests inject the rename and reopen failures through test-only flags. One checks a failed rename alone leaves the log usable. The other checks nothing is appended or read after both fail, and that reopening recovers.
Local:
cargo test -p nvram-sim --lib(19 passed), fmt and clippy clean. The new test fails with the fix disabled.Fixes #150