Seems it's an old post, but I have a similiar concern too.
The paper says that a removed server may send RequestVote RPC with new term number and cause the current leader to step down.
To prevent this, "if a server receives a RequestVote RPC within the minimum election timeout of hearing from a current
leader, it does not update its term or grant its vote."
Yet, maybe for some reason, a normal follower names F1 times out, and starts election with a new term number.
it will fail because of stale log.
and again, it will start another election with a higher term number, and will fail again.
and because its term number is greater than leader's, it will reject leader's AppendEntries request.
so follower F1 will repeat election forever, and can't be a normal part of the cluster again.
In my opinion, to avoid this happening, why not let F1 step down, that is:
when its RequestVote returns false, and find that there is already a leader with newer logs, then F1 set it's term to be the leader's term, and change to follower state.
Am I misunderstand something in Raft, I think I need some help here.
在 2013年10月26日星期六 UTC+8上午3:46:51,Diego Ongaro写道:Hi,
If your followers always time out and start a new election, you should
check to see that they are receiving heartbeats. Maybe add log
messages every time the leader sends heartbeats and every time the
followers receive them to check on this. Also, make sure that the
followers reset their election timers (to reasonable values) when they
receive heartbeats.
Hope this helps,
Diego
On Fri, Oct 25, 2013 at 2:53 AM, 樊冰心 <fanbin...@gmail.com> wrote:
> For some reason, a follower always receives the heartbeat timeout, causing
> frequent leader election. How to solve it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "raft-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to raft-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.