Skip to content

Commit

Permalink
embed: add "ExperimentalPreVote" for Raft
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Mar 6, 2018
1 parent 7891884 commit 3092d3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ type Config struct {
ExperimentalInitialCorruptCheck bool `json:"experimental-initial-corrupt-check"`
ExperimentalCorruptCheckTime time.Duration `json:"experimental-corrupt-check-time"`
ExperimentalEnableV2V3 string `json:"experimental-enable-v2v3"`

// ExperimentalPreVote is true to enable Raft Pre-Vote.
// If enabled, Raft runs an additional election phase
// to check whether it would get enough votes to win
// an election, thus minimizing disruptions.
// TODO: change to "pre-vote" and enable by default in 3.5.
ExperimentalPreVote bool `json:"experimental-pre-vote"`
}

// configYAML holds the config suitable for yaml parsing
Expand Down Expand Up @@ -293,6 +300,7 @@ func NewConfig() *Config {
EnableV2: DefaultEnableV2,
HostWhitelist: defaultHostWhitelist,
AuthToken: "simple",
ExperimentalPreVote: false, // TODO: enable by default in v3.5
}
cfg.InitialCluster = cfg.InitialClusterFromName(cfg.Name)
return cfg
Expand Down
1 change: 1 addition & 0 deletions embed/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) {
AuthToken: cfg.AuthToken,
InitialCorruptCheck: cfg.ExperimentalInitialCorruptCheck,
CorruptCheckTime: cfg.ExperimentalCorruptCheckTime,
PreVote: cfg.ExperimentalPreVote,
Debug: cfg.Debug,
}

Expand Down

0 comments on commit 3092d3b

Please sign in to comment.