-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
(2.14?) NRG: WAL must align with snapshot #7620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
server/raft_test.go
Outdated
| // Stop current node and restart it. | ||
| n.Stop() | ||
| n.WaitForStop() | ||
| // Restart. | ||
| n.Stop() | ||
| n.WaitForStop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, just left around due to copy pasting, resolved now.
b2c2b0a to
aaaa8ba
Compare
neilalexander
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one naming thing.
server/raft_test.go
Outdated
| } | ||
| } | ||
|
|
||
| func TestNRGTruncateLogWithMisingSnapshot(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Missing" instead of "Mising"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Maurice van Veen <[email protected]>
aaaa8ba to
6504333
Compare
The Raft log can have three states:
We previously were not checking that these align, this would allow for the snapshot to be non-existent but the WAL to be way ahead or there to be a gap (somehow) between the snapshot and WAL itself. Both could lead to data loss.
Normally this shouldn't be an issue though, as these will always align. But, could potentially happen if a snapshot and the tail of the WAL were durably written, but somehow the head of the WAL was not.
Signed-off-by: Maurice van Veen [email protected]