Browse code

Merge pull request #36672 from anshulpundir/election

Increase raft ElectionTick to 10xHeartbeatTick

Sebastiaan van Stijn authored on 2018/03/24 03:57:24
Showing 1 changed files
... ...
@@ -124,8 +124,11 @@ func (n *nodeRunner) start(conf nodeStartConfig) error {
124 124
 			n.cluster.config.Backend,
125 125
 			n.cluster.config.PluginBackend,
126 126
 			n.cluster.config.ImageBackend),
127
-		HeartbeatTick:    1,
128
-		ElectionTick:     3,
127
+		HeartbeatTick: 1,
128
+		// Recommended value in etcd/raft is 10 x (HeartbeatTick).
129
+		// Lower values were seen to have caused instability because of
130
+		// frequent leader elections when running on flakey networks.
131
+		ElectionTick:     10,
129 132
 		UnlockKey:        conf.lockKey,
130 133
 		AutoLockManagers: conf.autolock,
131 134
 		PluginGetter:     n.cluster.config.Backend.PluginGetter(),