Repository: kudu
Updated Branches:
  refs/heads/master dd49515f3 -> b069dd28b


make election timeout jitter more aggressive

Random election timeout jitter is necessary in Raft in order to
guarantee that an election can be won. If the jitter is smaller than RTT
or the accuracy of clocks, then elections could fail indefinitely. We
frequently hit an issue during tests where timeouts tend to 'clump'
together, causing elections to retry many times in a row, ultimately
leading to test timeout. This commit increases the jitter, so that
election timeout differences between nodes will hopefully be greater
than the clock error. This issue could also manifest if the RTT between
nodes is high.

Change-Id: I2c9dad820c2b7d4bc4b9e791b78222559cdf63c8
Reviewed-on: http://gerrit.cloudera.org:8080/3828
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <d...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/b069dd28
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/b069dd28
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/b069dd28

Branch: refs/heads/master
Commit: b069dd28b5ef52a4b2f096ef7601b24a55e49117
Parents: dd49515
Author: Dan Burkert <d...@cloudera.com>
Authored: Fri Sep 16 10:32:41 2016 -0700
Committer: Dan Burkert <d...@cloudera.com>
Committed: Fri Sep 16 21:41:49 2016 +0000

----------------------------------------------------------------------
 src/kudu/consensus/raft_consensus.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b069dd28/src/kudu/consensus/raft_consensus.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/raft_consensus.cc 
b/src/kudu/consensus/raft_consensus.cc
index 5e88be7..7a302b5 100644
--- a/src/kudu/consensus/raft_consensus.cc
+++ b/src/kudu/consensus/raft_consensus.cc
@@ -1997,7 +1997,7 @@ MonoDelta 
RaftConsensus::LeaderElectionExpBackoffDeltaUnlocked() {
   int term_difference =  state_->GetCurrentTermUnlocked() -
       state_->GetTermWithLastCommittedOpUnlocked();
 
-  double backoff_factor = pow(1.1, term_difference);
+  double backoff_factor = pow(1.5, term_difference);
   double min_timeout = MinimumElectionTimeout().ToMilliseconds();
   double max_timeout = std::min<double>(
       min_timeout * backoff_factor,

Reply via email to