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

termAt can return wrong term for first item

Open schuster opened this issue 9 years ago • 1 comments

The termAt method will return the wrong term in the case where the first entry in the log actually comes from a term other than term 1 (could happen if multiple elections occur before a request is sent). This is related to the inconsistent use of index numbers - the test should be for an index less than 0, not less than or equal to.

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