Skip to content

Enable prevote in some raft scenarios#7498

Merged
achamayou merged 6 commits intomicrosoft:mainfrom
cjen1-msft:partial-enable-pre-vote-tracing
Dec 1, 2025
Merged

Enable prevote in some raft scenarios#7498
achamayou merged 6 commits intomicrosoft:mainfrom
cjen1-msft:partial-enable-pre-vote-tracing

Conversation

@cjen1-msft
Copy link
Copy Markdown
Contributor

@cjen1-msft cjen1-msft commented Dec 1, 2025

This PR enabled pre-vote in all the scenarios where it is trivial to do so - the scenario does not rely on elections, or it just requires an additional round of communication to pass the pre-vote step.

Additionally I've added a replacement for retire_backup (retire_backup_pre_vote) which mirrors the original until the test is blocked by pre-vote round.
I've also cleaned up the retire_backup scenario as there were a couple of places where using finer grained messaging made the flow easier to understand.

@cjen1-msft cjen1-msft requested a review from a team as a code owner December 1, 2025 09:44
Copilot AI review requested due to automatic review settings December 1, 2025 09:44
@cjen1-msft cjen1-msft changed the title Enable prevote in some tests Enable prevote in some raft scenarios Dec 1, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 enables pre-vote in Raft consensus test scenarios where it can be trivially integrated, improving test coverage for the pre-vote election safety mechanism. The changes primarily add pre-vote configuration and adjust test flows to account for the additional PreVoteCandidate state in the election process.

Key changes:

  • Enables pre_vote_enabled,true in 14 existing test scenarios where elections are either not tested or require minimal adjustments
  • Adds a new retire_backup_pre_vote test that demonstrates pre-vote prevents leadership disruption when a removed node reconnects
  • Updates election-related tests with PreVoteCandidate state assertions and corresponding message dispatch sequences

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/raft_scenarios/suffix_collision.{1,2,3} Enables pre-vote configuration
tests/raft_scenarios/soft_rollback Explicitly disables pre-vote as test relies on specific rollback behavior; also corrects assertion from "Primary" to "Leader"
tests/raft_scenarios/rollback_safety Enables pre-vote and adds PreVoteCandidate state transitions at three election points
tests/raft_scenarios/retire_one Enables pre-vote configuration
tests/raft_scenarios/retire_backup_pre_vote New test demonstrating that pre-vote prevents removed nodes from disrupting leadership
tests/raft_scenarios/replicate Enables pre-vote configuration
tests/raft_scenarios/reelection Enables pre-vote and updates election flow to check for PreVoteCandidate state
tests/raft_scenarios/reconnect Enables pre-vote configuration
tests/raft_scenarios/reconfiguration Enables pre-vote configuration
tests/raft_scenarios/multi_election Enables pre-vote configuration
tests/raft_scenarios/liveness_through_conflict Enables pre-vote and adds PreVoteCandidate state transition during election
tests/raft_scenarios/fancy_election.{1,2} Enables pre-vote and updates election sequence with PreVoteCandidate checks
tests/raft_scenarios/election_while_reconfiguration Enables pre-vote and comprehensively updates election flow during reconfiguration with PreVoteCandidate state transitions
tests/raft_scenarios/check_quorum Enables pre-vote configuration
tests/raft_scenarios/append Enables pre-vote configuration
tests/raft_scenarios/ackuracy Enables pre-vote and adds PreVoteCandidate state transitions at three election points

@achamayou achamayou enabled auto-merge (squash) December 1, 2025 13:14
@achamayou achamayou merged commit 4a644da into microsoft:main Dec 1, 2025
17 checks passed
@cjen1-msft cjen1-msft deleted the partial-enable-pre-vote-tracing branch January 16, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants