Does a Leader Retain Leadership After Restart in Raft Algorithm?

30 views
Skip to first unread message

bz1988

unread,
Sep 26, 2024, 1:53:07 PM9/26/24
to raft-dev
When a leader node in a Raft cluster restarts, does it retain its leadership role upon rejoining the cluster? Specifically, if the leader comes back online before the followers' election timeouts expire, does it continue as the leader without triggering a new election? Or does the restarting node become a follower and participate in a new election process according to the Raft protocol?

Thank you in advance

Free Ekanayaka

unread,
Sep 26, 2024, 9:09:31 PM9/26/24
to bz1988, raft-dev
Hello,

in classic Raft information about votes received from other servers is
not persisted (only the vote that the server itself granted is
persisted). So when the leader restarts it has no way to know that it's
the leader.

One could imagine of persisting votes received from other nodes, but I'm
not sure if there are subtle the implications to consider, and it does
not feel like it is worth for most cases.

Free
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/raft-dev/374b8922-7561-41e0-b74e-35f44727ddf5n%40googlegroups.com.

Ejem Agbaeze

unread,
Sep 26, 2024, 9:09:55 PM9/26/24
to raft...@googlegroups.com

1. If the leader comes back online before the election timeout is exhausted on the followers then it continues as the leader. Peradventure, the heartbeat was delayed by network disruption not necessarily that the leader crashed.

2. If it comes back online when the followers  have elected a new leader, it joins as a follower.

3. Or if the restarted node cannot join on the leader election provided that the followers make up a majority of the cluster and after the election it joins as follower


On Thu, 26 Sept 2024, 6:53 pm bz1988, <bojan...@gmail.com> wrote:
When a leader node in a Raft cluster restarts, does it retain its leadership role upon rejoining the cluster? Specifically, if the leader comes back online before the followers' election timeouts expire, does it continue as the leader without triggering a new election? Or does the restarting node become a follower and participate in a new election process according to the Raft protocol?

Thank you in advance

--
Reply all
Reply to author
Forward
0 new messages