Todd Lipcon has submitted this change and it was merged. Change subject: KUDU-1365. Add leader pre-elections ......................................................................
KUDU-1365. Add leader pre-elections This implements the "pre-election" extension to the Raft algorithm. The idea is that, before calling a leader election, a candidate first sends a pre-election vote request to all voters. The voters respond as they would have in a real vote, except they don't actually record their vote. Cluster tests verify that this substantially reduces the election storms after a node has a temporarily slow disk or otherwise freezes. A new experimental flag 'raft_enable_pre_election' is introduced which defaults the feature to on, but provides a safety valve to disable this in case we find some bug after release. Tested this patch (along with the following series of cleanups) with: [1] 1000 loops of RaftConsensusITest.MultiThreadedInsertWithFailovers [2] 500 loops of raft-consensus-itest overall [3] 1000 loops of exactly_once_writes-itest The above tests have usually been pretty good about finding bugs in consensus in the past. [1] http://dist-test.cloudera.org//job?job_id=todd.1476502616.16080 [2] http://dist-test.cloudera.org//job?job_id=todd.1476503111.17428 [3] http://dist-test.cloudera.org//job?job_id=todd.1476503268.18454 Change-Id: Ifcfabd8c9ffe31f17ab768542a046426f656db43 Reviewed-on: http://gerrit.cloudera.org:8080/4694 Tested-by: Kudu Jenkins Reviewed-by: David Ribeiro Alves <[email protected]> --- M src/kudu/consensus/consensus.h M src/kudu/consensus/consensus.proto M src/kudu/consensus/leader_election-test.cc M src/kudu/consensus/leader_election.cc M src/kudu/consensus/leader_election.h M src/kudu/consensus/raft_consensus.cc M src/kudu/consensus/raft_consensus.h M src/kudu/consensus/raft_consensus_quorum-test.cc M src/kudu/integration-tests/raft_consensus-itest.cc M src/kudu/tserver/tablet_service.cc 10 files changed, 309 insertions(+), 144 deletions(-) Approvals: David Ribeiro Alves: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/4694 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifcfabd8c9ffe31f17ab768542a046426f656db43 Gerrit-PatchSet: 6 Gerrit-Project: kudu Gerrit-Branch: master 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]>
