akka-raft
akka-raft copied to clipboard
Empty batch is sent with term 1/index 1
In AppendEntries.apply
, if a batch is empty (e.g. because the follower is completely caught up and we're sending a heartbeat), the message is sent with prevLogTerm
1 and prevLogIndex
1. This is not necessarily correct; the numbers should be based off of what is actually at the end of the log.
For what it's worth, I have a (non-pull-request-worthy) fix for this issue here:
NetSys/sts2-applications@1840499
Tested by fuzz testing -- I verified that under non-failing scenarios, this behaves correctly at each step of the execution when replicated two client commands.