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

Joint Consensus #101

Merged
merged 50 commits into from
Feb 14, 2019
Merged

Joint Consensus #101

merged 50 commits into from
Feb 14, 2019

Conversation

Hoverbear
Copy link
Contributor

@Hoverbear Hoverbear commented Aug 8, 2018

This PR enables Joint Consensus as described by the Raft paper (https://raft.github.io/raft.pdf).

As of this commit it is possible to undergo arbitrary peer membership changes in a safe way.

Notably, this gives us a resilient "Replace Node" functionality, which is able to progress in the situation of a loss of both the old (removed) and new (added) peers go down. This is not possible with our previous one-at-a-time strategy.

Unfortunately, this feature is fairly large in scope. Thankfully it's mostly testing code!

There is some new API surface, notably the Raft::begin_membership_change function.

There is also some moved API surface. The RaftLog::applied_to function has been moved to Raft::commit_apply. The old function, while it still works, carries a deprection warning. In the future we should make it a function available to only Raft::applied_to.

Several APIs have changed to return errors instead of panic or otherwise ignore non-critical errors. In most cases you can just do old_call().ok() to have the same behavior.

Then, in order to facilitate the needs in testing, some additional API was added to the Network harness, which now can dispatch messages and not automatically send responses, allowing time to inspect the state of peers.

Finally, many tests were added to ensure Joint Consensus can work.

@Hoverbear Hoverbear added Work In Progress A work in progress. Do Not Merge A blocked PR. Please do not merge it. labels Aug 8, 2018
@Hoverbear Hoverbear added this to the 0.4.0 milestone Aug 8, 2018
@Hoverbear Hoverbear self-assigned this Aug 8, 2018
@Hoverbear Hoverbear requested review from BusyJay and removed request for BusyJay August 8, 2018 18:48
@Hoverbear Hoverbear force-pushed the joint-consensus branch 10 times, most recently from 7b72667 to 6cc0019 Compare August 14, 2018 22:48
@Hoverbear Hoverbear modified the milestones: 0.4.0, 0.5.0 Sep 11, 2018
@Hoverbear Hoverbear force-pushed the joint-consensus branch 4 times, most recently from e16a630 to d6986d9 Compare September 21, 2018 19:54
@Hoverbear Hoverbear force-pushed the joint-consensus branch 3 times, most recently from abbbe66 to b98e5a5 Compare September 26, 2018 02:19
src/progress.rs Show resolved Hide resolved
@Hoverbear Hoverbear requested a review from hicqu January 31, 2019 20:11
@Hoverbear
Copy link
Contributor Author

PTAL again pre-merge. Please pay particular attention to documentation.

@zhangjinpeng87
Copy link
Member

@BusyJay @hicqu PTAL again.

@hicqu
Copy link
Contributor

hicqu commented Feb 11, 2019

LGTM. PTAL @nolouch @BusyJay

@Hoverbear Hoverbear modified the milestones: 0.5.0, 0.6.0 Feb 11, 2019
@Hoverbear Hoverbear mentioned this pull request Feb 11, 2019
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hicqu hicqu merged commit 096c000 into master Feb 14, 2019
@ngaut ngaut deleted the joint-consensus branch February 14, 2019 08:05
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.

7 participants