Repository navigation
fix(quorum): a handover that fails is passed to the next member and retried - #676
Merged
Merged
Conversation
…etried The first nightly run of the operator e2e (43767783062) found the leader cut off from PostgreSQL still leading 90 s later, where a Kind lab handed over in 27 s. The handover targets the next member only, and a failed transfer used the 2-minute rest meant for successful ones, so nothing was tried again within the stage's 90 s. - Quorum.handOver tries each other member in turn, from the next one. - A failed handover no longer starts the rest: the next 5-second check tries again. - The e2e stage prints the cut leader's handover log when it fails.
This was referenced Nov 16, 2026
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.
A J4d follow-up from the first nightly run of the operator e2e (run 43767783062): the new PostgreSQL-cut stage failed with "q-…-0 still leads 90 s after losing PostgreSQL". Every other quorum stage passed in that run.
What I can say about the cause
I couldn't reproduce it. On a three-node Kind lab, the same sequence as CI (partition the leader, heal, cut the new leader from PostgreSQL right away) handed over in 30 s. The CI step printed no member logs, so the cause there is unproven. This PR closes the two ways the code could stall, and makes the next failure say why:
Quorum.handOvertargeted the next member alone. In CI's order that member had been partitioned from its peers a few seconds earlier, the one most likely not to take leadership straight away. It now tries every other member in turn, starting from the next.Proof
QuorumTest.aHandoverPassesOverAMemberThatCannotTakeIt: three real Ratis members; the member after the leader is closed; the handover goes to the third, which then alone takes writes.DatabaseHandoverTest.aFailedHandoverIsRetriedWithoutTheRest../mvnw test: 1940 tests and one failure,DisruptionReportPersistenceTest.aScheduledRunStoresItsReportOnce("execute wanted 1 time, was 2"). It's in the disruption scheduler, which this PR doesn't touch, and it passed 3 of 3 when run alone, so it's flaky.workflow_dispatchrun after merge. The e2e also runs on this PR, because it changeskates/…/quorum/.