Skip to content

[state/raft] Increase raft ElectionTick to 10xHeartbeatTick#2564

Merged
nishanttotla merged 1 commit into
moby:masterfrom
anshulpundir:leader
Mar 21, 2018
Merged

[state/raft] Increase raft ElectionTick to 10xHeartbeatTick#2564
nishanttotla merged 1 commit into
moby:masterfrom
anshulpundir:leader

Conversation

@anshulpundir
Copy link
Copy Markdown
Contributor

@anshulpundir anshulpundir commented Mar 20, 2018

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

Copy link
Copy Markdown
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable - LGTM pending CI. Thanks for finding the recommendation and fixing this @anshulpundir!

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2018

Codecov Report

Merging #2564 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            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).
Copy link
Copy Markdown
Contributor

@nishanttotla nishanttotla Mar 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Copy Markdown
Contributor

@nishanttotla nishanttotla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants