Closed moyeanl closed 3 months ago
If the follower is multiple terms behind it will replicate the log a term at a time rather than try and replicate all of the log crossing multiple terms. This simplifies some of the state management within the election and consensus module. Because of this it is preferred to bounce between FOLLOWER_LOG_REPLICATION and CANVASS to effectively query each leadership term as they are replicated. Thereby determining whether to jump to FOLLOWER_REPLAY or to follower FOLLOWER_REPLICATION based on progress.
If the follower is multiple terms behind it will replicate the log a term at a time rather than try and replicate all of the log crossing multiple terms. This simplifies some of the state management within the election and consensus module. Because of this it is preferred to bounce between FOLLOWER_LOG_REPLICATION and CANVASS to effectively query each leadership term as they are replicated. Thereby determining whether to jump to FOLLOWER_REPLAY or to follower FOLLOWER_REPLICATION based on progress.
Got it. Thanks a lot.
When the log replication of the follower node is done, it will enter the Canvass state and wait for the newLeadershipTerm message to enter the Follower Replay state. The only point to enter the Follower Replay state is onNewLeadershipTerm. Why not directly enter the FollowerLeplay state from the FollowerLogReplication state?