-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
storage: Write HardState atomically with committing splits #20704
Conversation
ed14866
to
8496576
Compare
Review status: 0 of 2 files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. pkg/storage/replica.go, line 4615 at r1 (raw file):
Consider linking to the issue here. pkg/storage/replica.go, line 4616 at r1 (raw file):
Would using pkg/storage/replica.go, line 4617 at r1 (raw file):
Is there any performance concern with this pkg/storage/store.go, line 1801 at r1 (raw file):
Is there a reason why these functions are in Comments from Reviewable |
Prior to this change, an ill-timed crash (between applying the raft command and calling splitPostApply) would leave the replica in a persistently broken state (no HardState). Found via jepsen. Fixes cockroachdb#20629 Fixes cockroachdb#20494 Release note (bugfix): Fixed a replica corruption that could occur if a process crashed in the middle of a range split.
8496576
to
e2b0f7b
Compare
Review status: 0 of 2 files reviewed at latest revision, 4 unresolved discussions. pkg/storage/replica.go, line 4615 at r1 (raw file): Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Done pkg/storage/replica.go, line 4616 at r1 (raw file): Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Perhaps, but that means encoding knowledge-at-a-distance that splitPreApply doesn't need to read anything else that may have been written in the batch. pkg/storage/replica.go, line 4617 at r1 (raw file): Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Yeah, splits are uncommon enough (and small enough) that I'm not concerned. Added a comment. pkg/storage/store.go, line 1801 at r1 (raw file): Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Historical reasons (and adjacency with Store.SplitRange, from which splitPostApply was extracted). I figure we'll gather all the split-related code into one place as a part of #18779. Comments from Reviewable |
Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from Reviewable |
Reviewed 1 of 2 files at r1, 1 of 1 files at r2. pkg/storage/replica.go, line 33 at r2 (raw file):
I remember having that problem back when I used Comments from Reviewable |
Prior to this change, an ill-timed crash (between applying the raft
command and calling splitPostApply) would leave the replica in a
persistently broken state (no HardState).
Found via jepsen.
Fixes #20629
Fixes #20494
Release note (bugfix): Fixed a replica corruption that could occur if
a process crashed in the middle of a range split.