Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node not part of the cluster is not allowed to vote (#477)
* add test to verify that a removed node is not able to vote * add some comments to the tests * add wait loop to test * remove test related to removed node voting * add test that check a removed node is not allowed to vote * add wait loop to make test more robust * increase timeout * Revert "increase timeout" This reverts commit 316c59a. * add ID to `RequestVoteRequest` and check if the node is part of the cluster before granting a vote * use request protocol version to ensure we have the right version * add `ID` and `Addr` as part of `RPCHeader` and do not fill `Candidate` and `Leader` in version > 3 * return `LeaderID` as part of the `Leader()` api * fix docstring * fix retro compatibility with version 3 * fix string casting * remove `EncodeID` and `DecodeID` from `transport` interface * add missing `leaderID` initialization * add protocol version 3 to version 4 upgrade test * increase test timeout * split test, and clean code * add docstrings to `RPCHeader` * Apply suggestions from code review Co-authored-by: Matt Keeler <mkeeler@users.noreply.github.com> * Fix comment Co-authored-by: Matt Keeler <mkeeler@users.noreply.github.com> * fix review comments * do not increment protocolVersion to 4 and rely on Addr/ID field being nil to fallback on the old fields. * deprecate `Leader` in favor of `LeaderWithID` * remove duplicate test and code clean up * add deprecation for `Leader` and `Candidate` fields * fix deprecation comments * check if node is voter instead if it's part of the cluster, nonVoter should not have votes granted. * add deprecation notice for Leader() API. Co-authored-by: Matt Keeler <mkeeler@users.noreply.github.com>
- Loading branch information
1 parent
1979b11
commit 38cb186
Showing
11 changed files
with
425 additions
and
66 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
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.