Hold two election tests to the real vote round - #126
Merged
Conversation
Both tests still described the promotion path as it behaved before elections became a real vote round, so they have been failing on main. One asserted that promoting a stale replica reports it as lagging. That answer came from a local precheck which read cached peer state; promotion now runs the vote round, and an out-of-date candidate is refused because no up-to-date voter will grant it. The outcome that matters is unchanged and still asserted: it does not become leader. The other asserted that a follower carries no recorded vote after an election promoted someone else. It does carry one -- that is the per-term vote bookkeeping the algorithm relies on, and wiping it was the old behaviour.
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.
Both tests still described the promotion path as it behaved before elections became a real vote round, so they have been failing on main.
One asserted that promoting a stale replica reports it as lagging. That answer came from a local precheck which read cached peer state; promotion now runs the vote round, and an out-of-date candidate is refused because no up-to-date voter will grant it. The outcome that matters is unchanged and still asserted: it does not become leader.
The other asserted that a follower carries no recorded vote after an election promoted someone else. It does carry one — that is the per-term vote bookkeeping the algorithm relies on, and wiping it was the old behaviour.
Test-only change. The raft suite goes from 2 failing to 194 passed, 0 failed (
--test-threads=1; the suite's own fixed ports make parallel runs flaky).