8000 Expose swarmkit's Raft tuning parameters in engine config by chungers · Pull Request #36726 · moby/moby · GitHub
[go: up one dir, main page]

Skip to content

Conversation

chungers
Copy link
Contributor

Signed-off-by: David Chung david.chung@docker.com

- What I did
This PR exposes the HeartbeatTick and ElectionTick 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)

Signed-off-by: David Chung <david.chung@docker.com>
@codecov
Copy link
codecov bot commented Mar 29, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@18d1688). Click here to learn what that means.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master   #36726   +/-   ##
=========================================
  Coverage          ?    35.2%           
=========================================
  Files             ?      613           
  Lines             ?    45562           
  Branches          ?        0           
=========================================
  Hits              ?    16038           
  Misses            ?    27396           
  Partials          ?     2128

Copy link
Contributor
@boaz0 boaz0 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Member
@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

SGTM

@stevvooe
Copy link
Contributor

LGTM

1 similar comment
@tonistiigi
Copy link
Member

LGTM

@tonistiigi tonistiigi merged commit 8b6a827 into moby:master Mar 30, 2018
@thaJeztah
Copy link
Member

Looks like this needs an update in the docs, also;

  • should this be exposed as a flag as well?
  • is this configuration live-reloadable?

}
if config.RaftElectionTick == 0 {
// 10X heartbeat tick is the recommended ratio according to etcd docs.
config.RaftElectionTick = 10 * config.RaftHeartbeatTick
Copy link
Member

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?

Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0