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

leader election without log involved? #63

Open
stevezhang-dstring opened this issue May 2, 2018 · 8 comments
Open

leader election without log involved? #63

stevezhang-dstring opened this issue May 2, 2018 · 8 comments
Labels

Comments

@stevezhang-dstring
Copy link

Hi Willem,

Your implementation on Raft is pretty cool for solving the replicated finite state machine problem. If I only focus on the leader election, no log needs to maintain (e.g., no raft_recv_entry() call from clients), which means we only depend on the term parameter for the election, could I still use it as a leader election?

Thanks,
Shifeng

@willemt
Copy link
Owner

willemt commented May 17, 2018

Hi Shifeng

Yes the library will work without raft_recv_entry .

But please be aware that if you need dynamic membership changes, you MUST append logs.

@willemt willemt added the FAQ label May 17, 2018
@stevezhang-dstring
Copy link
Author

Thanks Willem! I tested with no raft_recv_entry() call / no log maintainance, and the election did work as well.

As for the dynamic membership changes, suppose I have a five servers {A,B,C,D,E} configuration. If any one of those server crashed and rebooted to join again, is it kind of dynamic membership change? In my test, I killed one server, and the rest four servers still can elect a new leader as well (though I did not test the reboot+join, but the leader will send the appendentries to the rebooted server who will become the follower again).

My understanding of the dynamic membership change is the original configuration changed. For example, the {A,B,C,D,E} changed to {A.B,C,D,F}. (from the raft paper, "it will occasionally be necessary to change the configuration, for example to replace servers when they fail or to change the degree of replication")

Thanks,
Shifeng

@willemt
Copy link
Owner

willemt commented May 17, 2018

As for the dynamic membership changes, suppose I have a five servers {A,B,C,D,E} configuration. If any one of those server crashed and rebooted to join again, is it kind of dynamic membership change?

No this isn't a dynamic membership change. It's just normal recovery.

For example, the {A,B,C,D,E} changed to {A.B,C,D,F}.

If you change the membership while the servers are online, then yes, this is a dynamic membership change. Please check out https://github.com/willemt/raft#membership-changes. Dynamic membership changes can only be done via raft_recv_entry. This means dynamic membership changes MUST use the log.

If membership is static (eg. {A,B,C,D,E} never changes), then you don't need to use the log. It's worth pointing out, that if you can change the membership (eg. {A,B,C,D,E} changed to {A.B,C,D,F}) while the servers are offline, then you don't need to use the log!

@stevezhang-dstring
Copy link
Author

Thanks for the clarification!

Shifeng

@freeekanayaka
Copy link
Contributor

It seems @willemt comprehensively replied to this question. @ShifengZhang can this issue be closed?

@freeekanayaka
Copy link
Contributor

Perhaps a FAQ file could be added and linked from the README. The conversation from this issue (and other issues marked with the "FAQ" tag) be copied there, so they don't remain open but the information is still reasonably visible.

@willemt
Copy link
Owner

willemt commented Aug 9, 2018

hi @freeekanayaka, I am following the "label important issues as FAQ and keep them open" style that https://github.com/h2o/h2o does. An FAQ file sounds nice, but I haven't seen projects use them. I'll give this a think. It would be nice to remove some issues

@stevezhang-dstring
Copy link
Author

Yes, I think this issue is helpful; and I can close it or keep open to follow the "label important issues as FAQ and keep them open" style. Either way works for me.

Thanks.

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

3 participants