Model Raft leadership nomination edge cases - #8126
Open
Amaury Chamayou (achamayou) wants to merge 13 commits into
Open
Model Raft leadership nomination edge cases#8126Amaury Chamayou (achamayou) wants to merge 13 commits into
Amaury Chamayou (achamayou) wants to merge 13 commits into
Conversation
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
August 6, 2026 13:49
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Raft TLA+ consensus model so ProposeVoteRequest (leadership nomination) messages are ignored and discarded when their term does not match the recipient’s currentTerm, matching the C++ implementation, and adds a deterministic Raft-driver scenario to exercise this case.
Changes:
- Exclude
ProposeVoteRequestfromUpdateTerm, preventing term advancement due to nomination messages. - Update
RcvProposeVoteRequestto explicitly discard mismatched-term nominations while leaving node state unchanged. - Add
tests/raft_scenarios/late_nominationto validate that a delayed, stale nomination does not restart candidacy.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tla/consensus/ccfraft.tla | Aligns the TLA receive/update-term logic with C++ behavior for stale ProposeVoteRequest nominations. |
| tests/raft_scenarios/late_nomination | Adds a deterministic scenario where a delayed term-2 nomination arrives after the recipient advances to term 3, and must be ignored. |
Amaury Chamayou (achamayou)
marked this pull request as draft
August 6, 2026 16:10
Amaury Chamayou (achamayou)
marked this pull request as ready for review
August 7, 2026 10:53
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
August 7, 2026 12:58
View session
…t path Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
cjen1-msft
approved these changes
Aug 10, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Align the TLA+ consensus model and C++ tracing with leadership nomination edge cases.
Changes
ProposeVoteRequestwhen its term differs from the recipient current term.late_nomination, where a node advances to term 3 before receiving a term-2 nomination and remains a candidate.step_down_and_nominate_successortracing only when an explicit nomination selects a successor and sendsProposeVoteRequest.nominate_without_successor, where a single-node leader remains leader and queues no proposal or nomination trace event.Validation
raft_driverbuilds pass.late_nominationemits one explicit nomination event;nominate_without_successoremits none.