Mike Percy has submitted this change and it was merged. (
http://gerrit.cloudera.org:8080/9260 )
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
Reviewed-on: http://gerrit.cloudera.org:8080/9260
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Kudu Jenkins
---
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, 75 insertions(+), 14 deletions(-)
Approvals:
Alexey Serbin: Looks good to me, approved
Kudu Jenkins: Verified
--
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: merged
Gerrit-Change-Id: Ic28f15c40ce99f89481cb6869d4843cbc024ed48
Gerrit-Change-Number: 9260
Gerrit-PatchSet: 3
Gerrit-Owner: Mike Percy <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <[email protected]>