[backport 3.2] raft: fix election deadlock when nodes have election_mode off#12020
Merged
sergepetrenko merged 1 commit intorelease/3.2from Nov 10, 2025
Merged
[backport 3.2] raft: fix election deadlock when nodes have election_mode off#12020sergepetrenko merged 1 commit intorelease/3.2from
sergepetrenko merged 1 commit intorelease/3.2from
Conversation
Forcing nodes with `is_enabled=false` to always broadcast `is_leader_seen=false`. This allows candidate nodes to immediately clear witness map bits for non-participating nodes, enabling elections to proceed with only active participants. Closes #12018 NO_DOC=bugfix (cherry picked from commit 214b54c)
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.
(This PR is a backport of #11981 to
release/3.2to a future3.2.3release.)Closes #12018
When instances with
election_mode=offexist in a replicaset, they continue to broadcastis_leader_seen=trueeven after the leader dies. (Their death detection timers never start since RAFT is disabled for them). This causes theleader_witness_mapbits for these hosts to remain set indefinitely on candidate nodes, blocking elections since the pre-vote protection check requiresleader_witness_map==0.The root cause is that
election_mode=offnodes cannot be distinguished from active voters in RAFT messages. Both report statefollowerwithis_leader_seenbased on local state, butelection_mode=offnodes never update their view since heartbeat processing exits early when raft is disabled.This fix forces nodes with
election_mode=offto always broadcastis_leader_seen=false. This allows candidate nodes to immediately clear witness map bits for non-participating nodes, enabling elections to proceed with only active participants.Is this the right approach or have I missed anything?