I have a question about a detailed behavior of log replication in Raft.
Figure. 2 of extended Raft paper said:
- nextIndex is initialized to leader last log + 1 after election
- If last log index >= nextIndex for a follower: send AppendEntries RPC with log entries starting at nextIndex.
So, in my understanding, the following situation can happens.
- S1 (Leader, Term:10) received command X from client.
- S2 (Follower, Term:10) starts to election and becomes Leader
- ...
- S1 (Leader, Term:13) elected as Leader (reinitialized nextIndex to leader last log + 1)
- Then, S1 does not send Append Entries RPC with logs including command X to followers until received next command from client.
But, (d) of Fig.8 looks sending Append Entries RPC with "3" right after S5 was elected. Fig.8
Could anyone tell me why this happens? Or am I mistaken?