Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
Helium
-
None
-
None
-
Operating System: All
Platform: All
-
1978
-
High
Description
In the raft implementation when the Leader is created it's commit index is initialized to the last index in the log. This could be a problem in the following scenario.
member-1 is a leader and it has commitIndex = 10 and lastIndex = 11
member-2 is a follower and is has commitIndex = 10 and lastIndex = 11
member-3 is a follower and it has commitIndex = 10 and lastIndex = 10
member-1 dies before it can switch the commitIndex to 11 and therefore apply state and return a success to the client
A new election occurs in which member-2 gets chosen as the leader. Now member-2 assumes that it's commitIndex = 11 even though it does not have consensus from member-3.
Evaluate if this is a problem. One possible fix for it would be to not change the commitIndex on the new Leader at all and let it sync up with it's followers before resetting it's commit index.