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

Allows single node Raft to apply entries #71

Merged
merged 1 commit into from Oct 29, 2019

Conversation

npepinpe
Copy link
Contributor

Related to #69

  • pass majority to RequestTable on creation to commit entries immediately if possible
  • check if entry is committed after setting it on the leader and apply it immediately if so

Note: as mentioned in #69, by using the leader's vote, we could allow the log entries to be appended asynchronously and once finished add the vote to the request table.

One small thing, I would have preferred that applying the entry is done after we return the future in setAsync, but I didn't see any facilities for this. I know some Raft implementations will sometimes decouple the state machine and the Raft itself in different execution contexts, such that applying is also done asynchronously; this has some other issues (i.e. buffering apply calls), but could be an approach.

- pass majority to RequestTable on creation to commit entries
immediately if possible
- check if entry is committed after setting it on the leader and apply
it immediately if so
@belaban
Copy link
Member

belaban commented Oct 28, 2019

Hey Nicolas
I'll look into this this week, thanks!
I think we can close #69?

@npepinpe
Copy link
Contributor Author

Thanks for the quick reply! This would solve #69 yes.

belaban added a commit that referenced this pull request Oct 29, 2019
@belaban belaban merged commit c39d879 into jgroups-extras:master Oct 29, 2019
@belaban
Copy link
Member

belaban commented Oct 29, 2019

OK, so I applied your PR (with minor, mainly cosmetic, changes).
I commented RAFT.updateMatchIndex(), what was the intent of adding it?

@npepinpe
Copy link
Contributor Author

Ah, you can remove it, I'm sorry that was a left over from an initial approach. Sorry about that

Thanks for the quick review!

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

Successfully merging this pull request may close these issues.

None yet

2 participants