[CONTROLLER-867] Clustering : Leader initializes commit index to last index Created: 19/Sep/14  Updated: 22/Sep/14  Resolved: 22/Sep/14

Status: Resolved
Project: controller
Component/s: mdsal
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Moiz Raja Assignee: Kamal Rameshan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 1978
Priority: 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.



 Comments   
Comment by Kamal Rameshan [ 22/Sep/14 ]

https://git.opendaylight.org/gerrit/#/c/11391/

Merged.

Generated at Wed Feb 07 19:54:04 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.