-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Expose swarmkit's Raft tuning parameters in engine config #36726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: David Chung <david.chung@docker.com>
Codecov Report
@@ Coverage Diff @@
## master #36726 +/- ##
=========================================
Coverage ? 35.2%
=========================================
Files ? 613
Lines ? 45562
Branches ? 0
=========================================
Hits ? 16038
Misses ? 27396
Partials ? 2128 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
LGTM |
1 similar comment
LGTM |
Looks like this needs an update in the docs, also;
|
} | ||
if config.RaftElectionTick == 0 { | ||
// 10X heartbeat tick is the recommended ratio according to etcd docs. | ||
config.RaftElectionTick = 10 * config.RaftHeartbeatTick |
There was a problem hiding 8000 this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if I configure RaftElectionTick < RaftHeartbeatTick
? Should RaftElectionTick
always be multiple times RaftHeartbeatTick
? If so; should we add validation here, or have a ratio
instead as configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This here doesn't enforce that RaftElectionTick
should always be > than RaftHearbeatTick
and should be at least 10 (which is the default value when nothing is set).
I can add a check to return an error when RaftElectionTick
is strictly greater than RaftHeartbeatTick
and prevent the daemon from starting up. Is this acceptable?
Signed-off-by: David Chung david.chung@docker.com
- What I did
This PR exposes the
HeartbeatTick
andElectionTick
parameters for Swarmkit's Raft quorum. This allows tuning of the leader election behavior of the Swarm managers. This PR contains default values so these settings are strictly optional. Changing these settings can adjust the sensitivity of Swarm managers to transient events in their environment and make the quorum more stable.- How I did it
Swarmkit already exposes these parameters but they are previously hardcoded. This PR plumbs these settings through to expose them in the daemon's config.
- How to verify it
Changing the daemon's config JSON should override the default values.
- Description for the changelog
Make Swarm manager Raft quorum parameters configurable in daemon config.
- A picture of a cute animal (not mandatory but encouraged)