Skip to content

[backport 3.2] raft: fix election deadlock when nodes have election_mode off#12020

Merged
sergepetrenko merged 1 commit intorelease/3.2from
backport/release/3.2/11981
Nov 10, 2025
Merged

[backport 3.2] raft: fix election deadlock when nodes have election_mode off#12020
sergepetrenko merged 1 commit intorelease/3.2from
backport/release/3.2/11981

Conversation

@TarantoolBot
Copy link
Collaborator

@TarantoolBot TarantoolBot commented Nov 7, 2025

(This PR is a backport of #11981 to release/3.2 to a future 3.2.3 release.)


Closes #12018

When instances with election_mode=off exist in a replicaset, they continue to broadcast is_leader_seen=true even after the leader dies. (Their death detection timers never start since RAFT is disabled for them). This causes the leader_witness_map bits for these hosts to remain set indefinitely on candidate nodes, blocking elections since the pre-vote protection check requires leader_witness_map==0.

The root cause is that election_mode=off nodes cannot be distinguished from active voters in RAFT messages. Both report state follower with is_leader_seen based on local state, but election_mode=off nodes never update their view since heartbeat processing exits early when raft is disabled.

This fix forces nodes with election_mode=off 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.

Is this the right approach or have I missed anything?

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)
@TarantoolBot TarantoolBot requested a review from a team as a code owner November 7, 2025 15:50
@TarantoolBot TarantoolBot changed the title [Backport release/3.2] raft: fix election deadlock when nodes have election_mode off [backport 3.2] raft: fix election deadlock when nodes have election_mode off Nov 7, 2025
@coveralls
Copy link

Coverage Status

coverage: 87.444% (+0.01%) from 87.434%
when pulling e97d0f6 on backport/release/3.2/11981
into 9b8aa33
on release/3.2
.

@sergepetrenko sergepetrenko merged commit b8e2431 into release/3.2 Nov 10, 2025
24 checks passed
@sergepetrenko sergepetrenko deleted the backport/release/3.2/11981 branch November 10, 2025 07:28
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.

4 participants