Expose swarmkit's Raft tuning parameters in engine config#36726
Expose swarmkit's Raft tuning parameters in engine config#36726tonistiigi merged 1 commit intomoby:masterfrom
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 |
|
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 this comment.
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.
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
HeartbeatTickandElectionTickparameters 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)