Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Inconsistent use of index numbers #37

Open
schuster opened this issue Apr 15, 2015 · 1 comment
Open

Inconsistent use of index numbers #37

schuster opened this issue Apr 15, 2015 · 1 comment
Milestone

Comments

@schuster
Copy link

The index numbers used in the code are confusing and seem to be inconsistent. The indices in the log will start at 0. However, an AppendEntries with an empty list of entries to send will indicate its last index as 1, which would actually be the second index in the log (I would expect this to be 0). I seem to recall similar issues, but can't seem to find them now.

The code should be consistent on what the start index of the log is, and what number indicates "this is before the start of the log". The tech report uses 0 as a special index value to indicate a point before the beginning of the log and starts the log at index 1, but -1 and 0 could be used equally well. Whichever way is used should be documented somewhere in the code.

@colin-scott
Copy link
Contributor

For what it's worth, I have a (non-pull-request-worthy) fix for this issue here:

NetSys/demi-applications@1840499
NetSys/demi-applications@6f15bcf

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants