Repository navigation
Raft Cluster: replace failed voters one at a time - #5762
quanyeyang wants to merge 2 commits into
Conversation
Count only non-FAIL voters toward the promotion target. This lets the leader promote a caught-up learner when a failed voter still occupies a seat. Once the voting set exceeds the target, demote a voter that is still marked FAIL if the remaining voters have a responsive majority. Reevaluate membership after each applied change. A failed yes voter can also be replaced and is eligible for promotion again after recovery. Signed-off-by: quanyeyang <quanyemostima@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Review stateReady for human review. Risk: High. The leader's automatic ADD_VOTER/DEL_VOTER decisions change the Raft voting set, so a wrong choice can cost the cluster its quorum. Open findings: none. Resolved (1)
Backport: Not needed. The PR targets the cluster-v2 feature branch and RAFT_TARGET_VOTERS / cluster_raft.c do not exist on any maintained release line. Updated for a2c54f1 at 2026-12-05 12:06 UTC. The bot rewrites this comment on every review. |
Use test_defer to re-enable reconnection on R0 even if an assertion fails, so the next voter policy test starts with reconnection enabled. Signed-off-by: quanyeyang <quanyemostima@gmail.com>
|
Fixes #5726
With five voters, a failed voter still counts toward the target. This can leave the cluster with four available voters even when a healthy learner has caught up and is ready to vote.
The leader now scans the nodes once and counts the voters without the
FAILflag. At the target, it promotes a caught-up learner first. Once that promotion is applied, the leader can demote a still-failed voter if the remaining voters have a responsive majority. If no learner is ready, the failed voter keeps its vote. If the voting set is already above the target, the leader can use the existing surplus.Each pass makes at most one membership change. With two failed voters and two eligible learners, the voting set goes from 5 to 6, back to 5, then repeats for the second failure. A failed
cluster-voter yesnode can also be demoted and will be eligible for promotion again once it recovers and catches up.The slot migration test now accepts a healthy
master,learner: a node can regain its role as a shard primary while remaining a Raft learner.Testing
The Raft cluster suite passed locally (978 tests). The regression tests check the order of changes with two failed voters, replacement after a lagging learner catches up, and re-promotion of a recovered
yesvoter.