Mike Percy has posted comments on this change. ( http://gerrit.cloudera.org:8080/8889 )
Change subject: [consensus] test-only option for replica replacement ...................................................................... Patch Set 1: Code-Review+1 (5 comments) looks good, just nits http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/quorum_util-test.cc File src/kudu/consensus/quorum_util-test.cc: http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/quorum_util-test.cc@958 PS1, Line 958: for (auto policy : {MHP_H, MHP_I}) nit: since this is repeated many times, consider extracting {MHP_H, MHP_I} into a const at the top of the file and use that instead: constexpr auto kPolicies = { MHP_H, MHP_I }; for (auto policy : kPolicies) { http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/quorum_util.cc File src/kudu/consensus/quorum_util.cc: http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/quorum_util.cc@448 PS1, Line 448: is_under_replicated && : (policy == MajorityHealthPolicy::HONOR : ? num_voters_healthy >= MajoritySize(num_voters_total) : true); how about: is_under_replicated && (num_voters_healthy >= MajoritySize(num_voters_total) || policy == MajorityHealthPolicy::IGNORE); http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/quorum_util.cc@640 PS1, Line 640: need_to_evict_non_voter && : (policy == MajorityHealthPolicy::HONOR : ? num_voters_healthy >= MajoritySize(num_voters_total) : true); how about: need_to_evict_non_voter && (num_voters_healthy >= MajoritySize(num_voters_total) || policy == MajorityHealthPolicy::IGNORE); http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/quorum_util.cc@683 PS1, Line 683: num_voters_total > replication_factor && : (policy == MajorityHealthPolicy::HONOR : ? num_voters_healthy >= MajoritySize(num_voters_total - 1) : true); nit: how about num_voters_total > replication_factor && (num_voters_healthy >= MajoritySize(num_voters_total - 1) || policy == MajorityHealthPolicy::IGNORE); http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/raft_consensus.cc File src/kudu/consensus/raft_consensus.cc: http://gerrit.cloudera.org:8080/#/c/8889/1/src/kudu/consensus/raft_consensus.cc@134 PS1, Line 134: appropriate s/appropriate/desired/ -- To view, visit http://gerrit.cloudera.org:8080/8889 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4f89b6c584296e3da5047475c5c86c4cb1118ad0 Gerrit-Change-Number: 8889 Gerrit-PatchSet: 1 Gerrit-Owner: Alexey Serbin <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Comment-Date: Fri, 22 Dec 2017 21:18:51 +0000 Gerrit-HasComments: Yes
