akka-raft icon indicating copy to clipboard operation
akka-raft copied to clipboard

Empty batch is sent with term 1/index 1

Open schuster opened this issue 9 years ago • 1 comments

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.

schuster avatar Apr 15 '15 15:04 schuster

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.

colin-scott avatar Aug 08 '15 09:08 colin-scott