Mike Percy has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/8245 )
Change subject: KUDU-2048. consensus: only evict unresponsive nodes if remaining voters are viable ...................................................................... KUDU-2048. consensus: only evict unresponsive nodes if remaining voters are viable This adds a heuristic to the leader when it is deciding whether to evict an unresponsive node. It will now only do so if the remaining nodes appear viable (i.e they have recently had a successful communication with the leader, are part of the most recent majority, etc). Along the way, this cleans up various bits of the per-peer state tracking and error handling code: - removes the 'is_new', 'is_last_exchange_successful', and 'needs_tablet_copy' booleans and replaces them with an enum tracking the status of the last exchange with each peer. This makes the code a little clearer since it resolves ambiguity about what a "successful" exchange is. - renames 'last_successful_communication_time' to 'last_communication_time' and clarifies the doc on this field. We actually update this time on any communication with the remote tablet server, even in cases where the remote replica is not in a good state (eg it needs a tablet copy or the tablet doesn't exist). We still update the field in this case, but the naming is now more representative. - cleans up the code in Peer::ProcessResponse so that each response case is more clearly delineated. This clean-up exposed the fact that we have no test coverage of the 'CANNOT_PREPARE' case. Added a TODO about this. Change-Id: I673f5b8a58b3954ea28066ecb334b3fdd60e7adb Reviewed-on: http://gerrit.cloudera.org:8080/8245 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <[email protected]> --- M src/kudu/consensus/consensus_peers.cc M src/kudu/consensus/consensus_queue-test.cc M src/kudu/consensus/consensus_queue.cc M src/kudu/consensus/consensus_queue.h M src/kudu/integration-tests/tablet_replacement-itest.cc 5 files changed, 321 insertions(+), 112 deletions(-) Approvals: Kudu Jenkins: Verified Mike Percy: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/8245 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I673f5b8a58b3954ea28066ecb334b3fdd60e7adb Gerrit-Change-Number: 8245 Gerrit-PatchSet: 7 Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: David Ribeiro Alves <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <[email protected]>
