raft: make MsgApp.Entries in StateProbe empty #131681
Labels
A-kv-replication
Relating to Raft, consensus, and coordination.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
C-performance
Perf of queries or internals. Solution not expected to change functional behavior.
When the follower replication flow is in
StateProbe
, the leader will likely sendMsgApp
s with log entries.The downsides of this:
RawNode
underReplica.mu
, soMsgApp
construction with entries may lead to IO under this mutex. We would like to minimize it: raft: fetch from log storage without holding Replica.mu #130955.A simple fix is to make
StateProbe
messages outright empty. However, this would have a performance impact because it's optimized for the happy case when the first probe is successful (and so some entries are replicated immediately). In a general case, this reduces post-StateProbe
replication latency by one roundtrip to the follower.There are some ideas in etcd-io/raft#150 on how to optimize these roundtrips differently. The "hints" in
MsgAppResp
can be extended to carry more information, as well as embedded in theMsgVoteResp
to eliminate the first post-election probing roundrip.Jira issue: CRDB-42653
The text was updated successfully, but these errors were encountered: