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

Fixes tests and plumbs more ServerAddress vs. string parameters. #127

Merged
merged 9 commits into from
Jul 1, 2016

Conversation

slackpad
Copy link
Contributor

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.

@slackpad slackpad mentioned this pull request Jun 28, 2016
14 tasks
}

// 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 {
Copy link
Contributor Author

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 slackpad changed the title Plumbs more ServerAddress vs. string parameters. Fixes tests and plumbs more ServerAddress vs. string parameters. Jun 28, 2016
James Phillips added 5 commits June 28, 2016 12:05
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.
@ongardie-sfdc
Copy link

lgtm, thanks for fixing those tests.

@slackpad slackpad merged commit da5602c into issue-84-integration Jul 1, 2016
@slackpad slackpad deleted the b-cleanup branch July 1, 2016 18:34
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

4 participants