[state/raft] Increase raft ElectionTick to 10xHeartbeatTick#2564
Merged
Conversation
cyli
approved these changes
Mar 20, 2018
Contributor
cyli
left a comment
There was a problem hiding this comment.
Seems reasonable - LGTM pending CI. Thanks for finding the recommendation and fixing this @anshulpundir!
Codecov Report
@@ Coverage Diff @@
## master #2564 +/- ##
==========================================
+ Coverage 61.47% 61.51% +0.03%
==========================================
Files 133 133
Lines 21765 21765
==========================================
+ Hits 13380 13388 +8
+ Misses 6949 6936 -13
- Partials 1436 1441 +5 |
| HeartbeatTick: 1, | ||
| ElectionTick: 3, | ||
| HeartbeatTick: 1, | ||
| // Recommended value in etcd/raft is 10 x (HeartbeatTick). |
Contributor
There was a problem hiding this comment.
Can we add more of a description around why? It would certainly be useful to at least add that historically lower values have potentially caused frequent leader elections.
nishanttotla
approved these changes
Mar 20, 2018
Contributor
nishanttotla
left a comment
There was a problem hiding this comment.
LGTM.
Thanks @anshulpundir. How did you discover this? Also, do we have a way of testing this (even if ad hoc)?
Signed-off-by: Anshul Pundir <anshul.pundir@docker.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change is to address recently seen frequent leader elections due to network flakiness.
ElectionTick is recommended to be 10xHeartbeatTick https://github.com/coreos/etcd/blob/master/raft/raft.go#L132