-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: compute quorum commit index instead of using raft.Status.Commit #10482
storage: compute quorum commit index instead of using raft.Status.Commit #10482
Conversation
Reviewed 2 of 2 files at r1. Comments from Reviewable |
as a quick fix for the current issues, although I think there are times where we'd want to truncate the logs even at the cost of a second snapshot, just like we don't require that 100% of the current replicas are up to date. The best way to do this may be to pass the pending snapshot index into getBehindIndex, where it gets appended to the list of log positions from the current replicas (treating the pending snapshot as if it's already been added to the configuration) Review status: all files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from Reviewable |
Don't we already effectively accomplish this by processing Review status: all files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from Reviewable |
edc9721
to
567ef20
Compare
Rewrote this so that we compute the quorum commit index ourselves and include the pending snapshot index in the computation. That accomplishes the same effect as the previous incarnation of this PR. PTAL. |
Reviewed 1 of 2 files at r2. pkg/storage/raft_log_queue.go, line 151 at r2 (raw file):
why is this still necessary? getQuorumIndex appears to take this into account now. pkg/storage/raft_log_queue.go, line 159 at r2 (raw file):
i think you can remove this now; it is no longer possible for this case to occur. Comments from Reviewable |
Review status: 1 of 2 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/storage/raft_log_queue.go, line 151 at r2 (raw file):
|
Review status: 1 of 2 files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. pkg/storage/raft_log_queue.go, line 151 at r2 (raw file):
|
567ef20
to
2d9708b
Compare
Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. pkg/storage/raft_log_queue.go, line 151 at r2 (raw file):
|
Reviewed 1 of 2 files at r2, 1 of 1 files at r3. pkg/storage/raft_log_queue.go, line 151 at r2 (raw file):
|
2d9708b
to
15bdc87
Compare
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/storage/raft_log_queue.go, line 151 at r2 (raw file):
|
Reviewed 2 of 2 files at r4. pkg/storage/raft_log_queue.go, line 151 at r2 (raw file):
|
Compute the index at which a quorum of nodes have committed instead of using raft.Status.Commit. The latter can be in advance of the computed quorum commit index just after a replica has been added to the group. And by computing the value ourselves we can include the pending snapshot index in the computation. Fixes cockroachdb#10409
15bdc87
to
561398f
Compare
Review status: 1 of 2 files reviewed at latest revision, 1 unresolved discussion. pkg/storage/raft_log_queue.go, line 144 at r4 (raw file):
|
Reviewed 1 of 1 files at r5. Comments from Reviewable |
Compute the index at which a quorum of nodes have committed instead of using raft.Status.Commit. The latter can be in advance of the computed quorum commit index just after a replica has been added to the group. And by computing the value ourselves we can include the pending snapshot index in the computation.
Fixes #10409
This change is