Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Candidate reverts to follower during raft_transfer with pre_vote on #203

Closed
MathieuBordere opened this issue May 6, 2021 · 2 comments · Fixed by #205
Closed

Candidate reverts to follower during raft_transfer with pre_vote on #203

MathieuBordere opened this issue May 6, 2021 · 2 comments · Fixed by #205
Assignees
Labels
Bug Confirmed to be a bug

Comments

@MathieuBordere
Copy link
Contributor

Below some debug logging, basically server 1 wants to transfer leadership to 2 through raft_transfer, server 2 receives the TimeoutNow message, becomes candidate, doesn't increase it's term due to pre_vote, receives a heartbeat from 1 and converts back to follower, nullifying the effect of the attempted leadership transfer.

raft_transfer self:1 to:2        
self:2 recv message:6 from:1 state:1 term:1
recvTimeoutNow:28
convertSetState id:2 new_state:2
electionStart:114
self:3 recv message:1 from:1 state:1 term:1
self:4 recv message:1 from:1 state:1 term:1
self:1 recv message:2 from:3 state:3 term:1
self:1 recv message:2 from:4 state:3 term:1
self:2 recv message:1 from:1 state:2 term:1
convertSetState id:2 new_state:1
@MathieuBordere
Copy link
Contributor Author

@freeekanayaka Should we just ignore the pre-vote step on a raft_transfer i.e. when disrupt_leader is set? The user specifically asked to transfer leadership, assuming that this was deliberate and the user knows what he's doing, we could skip the pre-vote logic no?

@freeekanayaka
Copy link
Contributor

@freeekanayaka Should we just ignore the pre-vote step on a raft_transfer i.e. when disrupt_leader is set? The user specifically asked to transfer leadership, assuming that this was deliberate and the user knows what he's doing, we could skip the pre-vote logic no?

Yeah I guess it'd make sense.

MathieuBordere pushed a commit to MathieuBordere/raft that referenced this issue Nov 19, 2021
By definition we have 'approval' to disrupt the leader, so disable the
pre-vote algorithm that actually prevents leader disruptions.

Will still prevent issue canonical#203
that is covered in the tests.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Confirmed to be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants