-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: Stop replication to removed node at once when new membership …
…is seen Before this commit, when membership changes, e.g., from a joint config `[(1,2,3), (3,4,5)]` to uniform config `[3,4,5]`(assuming the leader is `3`), the leader stops replication to `1,2` when `[3,4,5]` is committed. This is an unnecessarily complicated solution. It is OK for the leader to stop replication to `1,2` as soon as config `[3,4,5]` is seen, instead of when config `[3,4,5]` is committed. - If the leader(`3`) finally committed `[3,4,5]`, it will eventually stop replication to `1,2`. - If the leader(`3`) crashes before committing `[3,4,5]`: - And a new leader sees the membership config log `[3,4,5]`, it will continue to commit it and finally stop replication to `1,2`. - Or a new leader does not see membership config log `[3,4,5]`, it will re-establish replication to `1,2`. In any case, stopping replication at once is OK. One of the considerations about this modification is: The nodes, e.g., `1,2` do not know they have been removed from the cluster: - Removed node will enter the candidate state and keeps increasing its term and electing itself. This won't affect the working cluster: - The nodes in the working cluster have greater logs; thus, the election will never succeed. - The leader won't try to communicate with the removed nodes thus it won't see their higher `term`. - Removed nodes should be shut down finally. No matter whether the leader replicates the membership without these removed nodes to them, there should always be an external process that shuts them down. Because there is no guarantee that a removed node can receive the membership log in a finite time. Changes: - Change: remove config `remove_replication`, since replication will be removed at once. - Refactor: Engine outputs `Command::UpdateReplicationStream` to inform the Runtime to update replication, when membership changes. - Refactor: remove `ReplicationState.failures`, replication does not need count failures to remove it. - Refactor: remove `ReplicationState.matched`: the **matched** log id has been tracked by `Engine.state.leader.progress`. - Fix: #446
- Loading branch information
1 parent
d67199b
commit a010fdd
Showing
19 changed files
with
187 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.