Raft leader sends the commit index to followers via 2 channels:
log append messages (MsgApp)
heartbeats (MsgBeat)
The MsgApp channel does not entirely provide liveness for the follower commit index updates. The leader heuristically checks that the follower's commit index can be outdated, but there is no feedback from the follower confirming that the commit index was bumped. If the latest MsgApp is dropped, and the follower commit index is not updated, the leader will not necessarily send another one.
Heartbeats carry Commit index too, and happen regularly, so they help closing this liveness gap in cases when MsgApp delivery is lossy.
We want to make the MsgApp channel reliable, and remove the dependency on heartbeats. In order to do that, we need to introduce feedback from the follower, and leader to track something equivalent to the durable Match log index (but for the Commit index). The leader won't stop sending MsgApp pings to a (connected) follower until it knows that the latest commit index is durable on it.
Raft leader sends the commit index to followers via 2 channels:
MsgApp
)MsgBeat
)The
MsgApp
channel does not entirely provide liveness for the follower commit index updates. The leader heuristically checks that the follower's commit index can be outdated, but there is no feedback from the follower confirming that the commit index was bumped. If the latestMsgApp
is dropped, and the follower commit index is not updated, the leader will not necessarily send another one.Heartbeats carry
Commit
index too, and happen regularly, so they help closing this liveness gap in cases whenMsgApp
delivery is lossy.We want to make the
MsgApp
channel reliable, and remove the dependency on heartbeats. In order to do that, we need to introduce feedback from the follower, and leader to track something equivalent to the durableMatch
log index (but for theCommit
index). The leader won't stop sendingMsgApp
pings to a (connected) follower until it knows that the latest commit index is durable on it.Jira issue: CRDB-39357
Epic CRDB-39898