Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAFT: RequestTable needs to be populated when becoming leader #31

Closed
belaban opened this issue May 7, 2015 · 1 comment
Closed

RAFT: RequestTable needs to be populated when becoming leader #31

belaban opened this issue May 7, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@belaban
Copy link
Member

belaban commented May 7, 2015

When we have 2 requests (3-4) in the leader's RequestTable with last_applied=4 and commit_index=2, and the leader crashes and is restarted (or a new leader is started), then RequestTable needs to be populated with pending requests.
If this is not done, the new leader will start trying to commit pending entries 3 and 4 and when the AppendEntries responses are received, and the RequestTable is empty, we won't ever commit entries 3 and 4.
Solution: when becoming leader, populate RequestTable from the log: add entries in range [last_applied+1 .. commit_index].

@belaban belaban added the bug label May 7, 2015
@belaban belaban self-assigned this May 7, 2015
@belaban belaban added this to the 0.2 milestone May 7, 2015
belaban added a commit that referenced this issue May 7, 2015
- RAFT: leader resends message if its own commit_index is < its last_applied (#30)
- RAFT: a new leader populates its RequestTable with all entries between commit_index+1 and last_applied (#31)
@belaban
Copy link
Member Author

belaban commented May 7, 2015

Done in Leader.init() -> RAFT.createRequestTable()

@belaban belaban closed this as completed May 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant