-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fixes tests and plumbs more ServerAddress vs. string parameters. #127
Merged
Conversation
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
} | ||
|
||
// RemovePeer (deprecated) is used to remove a peer from the cluster. If the | ||
// current leader is being removed, it will cause a new election | ||
// to occur. This must be run on the leader or it will fail. | ||
// Use RemoveServer instead. | ||
func (r *Raft) RemovePeer(peer string) Future { | ||
func (r *Raft) RemovePeer(peer ServerAddress) Future { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally wanted to keep this as string
but this one was confusing (it's an address that we assume is the same as the ID). The trivial work to fix this is probably worth the clarity that the type provides.
slackpad
changed the title
Plumbs more ServerAddress vs. string parameters.
Fixes tests and plumbs more ServerAddress vs. string parameters.
Jun 28, 2016
Prior to the cluster membership refactor, a leader that removes itself from the cluster would have just itself as a peer, so it could continue operation on its own (it would never be able to disrupt the old quorum). Now the server will be left in a safer configuration where it doesn't have itself as a peer, so it will remain as a follower and not initiate a vote. The TestRaft_RemoveLeader_NoShutdown already verifies that the old leader remains in the follower state, so we remove this test since the behavior has now changed.
lgtm, thanks for fixing those tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This cleans up a couple of todo items and plumbs
ServerAddress
into more places for extra clarity. I decided that since the fix is trivial (just a cast to support old code) that it was worth breaking the interface to make the code super clear./cc @ongardie
Mentioning #84.