-
Notifications
You must be signed in to change notification settings - Fork 245
PreVote enabled in TLA model checking #7404
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
Conversation
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.
Pull Request Overview
This PR implements PreVote support in the TLA+ model checking specification for CCF Raft consensus. PreVote is a mechanism where followers must first prove they could be elected (via a speculative vote round) before becoming actual candidates, helping prevent disruptive election attempts.
Key changes:
- Added
PreVoteCandidateleadership state betweenFollowerandCandidate - Introduced
preVoteEnabledconfiguration variable to allow testing both with and without PreVote - Modified election logic to require majority pre-votes before transitioning to full candidacy
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tla/consensus/ccfraft.tla | Core PreVote implementation: new state, configuration variable, updated transitions and message handlers |
| tla/consensus/Traceccfraft.tla | Updated trace validation to include configVars in UNCHANGED clauses |
| tla/consensus/Traceccfraft.cfg | Added PreVoteCandidate constant mapping |
| tla/consensus/SIMccfraft.tla | Added simulation init to non-deterministically set preVoteEnabled |
| tla/consensus/SIMccfraft.cfg | Configured simulation to use new init function |
| tla/consensus/MCccfraft.tla | Added model checking init and debug invariant for PreVote |
| tla/consensus/MCccfraft.cfg | Added PreVoteCandidate constant and debug invariant |
|
This should be ready for review. I've cancelled the CI for now. Will rebase on main when the CI is quieter. |
Co-authored-by: Amaury Chamayou <amchamay@microsoft.com>
Co-authored-by: Amaury Chamayou <amchamay@microsoft.com>
|
Adding backported label - this was backported in #7436. |
Put succinctly, pre-vote requires that a follower must prove that it could be elected before becoming a candidate.
This is implemented as a special follower state:
PreVoteCandidatewhere the follower sends speculative requestVote messages.These RequestVotes do not have any actual change on the receiving node, but notify the PreVoteCandidate that that node would have voted for it.
This is a minimal PR to start getting model checking of this.
The current PR has: