Skip to content

Follower Replay

FOLLOWER_REPLAY - follower replays any unprocessed entries from the end of its Log to itself, ensuring the whole Log has been processed

On Entry

Enters from a number of states (see the state machine diagram). On entry, the follower has a Log Recording matching the leader's, so all entries in the Recording are 'Committed', and are safe to process.

Description

This state is the follower equivalent of LEADER_REPLAY. Rather than describe it again, please see that description.

The only difference is that this state does not publish NewLeadershipTerm or CommitPosition messages periodically, and it moves to different states once completed.

On Exit

By the end of this state, the follower Consensus Module will have replayed (processed) up to the end of its Log Recording, and the Clustered Service, which is running on its own thread, will have started doing the same (it carries on in the background). The commit-pos Counter is set to the position at the end of the Recording.

The member looks to see if catchupJoinPosition is set on the Election object. This is set onNewLeadershipTerm if the leader has already started processing messages in the current leadership term, meaning this member is missing entries. This member will need to use Catchup to back-fill the missing entries from the current leadership term, so it would move to FOLLOWER_CATCHUP_INIT.

If catchupJoinPosition is not set, Catchup is not required (the leader has not started accepting messages in the current leadership term yet), so it moves to FOLLOWER_LOG_INIT.