Skip to content

Follower Ballot

FOLLOWER_BALLOT - member has voted for a candidate, and awaits the election result. After the result, it moves to FOLLOWER_LOG_REPLICATION or FOLLOWER_REPLAY. If the election times out, it returns to CANVASS.

On Entry

Enters on receipt of a RequestVote message in onRequestVote, if it decided to respond with a positive Vote message.

Description

The member has just voted for a candidate, so it waits in this state for the election outcome, up to the election timeout (1 second). It is waiting for a NewLeadershipTerm message from the newly elected leader.

If it receives the message before the timeout, it then looks at its Log Recording to see whether it contains entries up to the start of the new leadership term. If it doesn't, it needs to replicate the missing entries from the new leader using Archive replication, so it moves to FOLLOWER_LOG_REPLICATION. If its Log Recording already contains up to the start of the new leadership term, it moves to FOLLOWER_REPLAY, where it will start to replay and process the Log Recording.

If it times out waiting for the NewLeadershipTerm, it returns to CANVASS.

On Exit

If the candidate that it voted for won, this member becomes a follower and moves to one of FOLLOWER_LOG_REPLICATION or FOLLOWER_REPLAY. If the election times out, it moves back to CANVASS.