Hello Alexey Serbin,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/9260
to review the following change.
Change subject: Add additonal form and tests for GetConsensusRole()
......................................................................
Add additonal form and tests for GetConsensusRole()
There are cases where calling GetConsensusRole() without creating a
ConsensusStatePB object would be more efficient. This patch adds a
version of GetConsensusRole() with the following signature:
RaftPeerPB::Role GetConsensusRole(const std::string& peer_uuid,
const std::string& leader_uuid,
const RaftConfigPB& config);
This patch also fixes a bug where the role of a non-voter that was
thought to be the leader would be returned as NON_PARTICIPANT instead of
LEARNER. However, that is an illegal state so it should not actually
affect production code.
Also added a unit test for both forms of GetConsensusRole().
Change-Id: Ic28f15c40ce99f89481cb6869d4843cbc024ed48
---
M src/kudu/consensus/quorum_util-test.cc
M src/kudu/consensus/quorum_util.cc
M src/kudu/consensus/quorum_util.h
3 files changed, 73 insertions(+), 14 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/60/9260/1
--
To view, visit http://gerrit.cloudera.org:8080/9260
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic28f15c40ce99f89481cb6869d4843cbc024ed48
Gerrit-Change-Number: 9260
Gerrit-PatchSet: 1
Gerrit-Owner: Mike Percy <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>