-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
migrate experimental-snapshot-catchup-entries flag to snapshot-catchup-entries #19352
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,7 @@ var ( | |
"experimental-bootstrap-defrag-threshold-megabytes": "bootstrap-defrag-threshold-megabytes", | ||
"experimental-max-learners": "max-learners", | ||
"experimental-memory-mlock": "memory-mlock", | ||
"experimental-snapshot-catchup-entries": "snapshot-catchup-entries", | ||
"experimental-compaction-sleep-interval": "compaction-sleep-interval", | ||
"experimental-downgrade-check-time": "downgrade-check-time", | ||
} | ||
|
@@ -185,12 +186,21 @@ type Config struct { | |
// TODO: remove it in 3.7. | ||
SnapshotCount uint64 `json:"snapshot-count"` | ||
|
||
// SnapshotCatchUpEntries is the number of entries for a slow follower | ||
// ExperimentalSnapshotCatchUpEntries is the number of entries for a slow follower | ||
// to catch-up after compacting the raft storage entries. | ||
// We expect the follower has a millisecond level latency with the leader. | ||
// The max throughput is around 10K. Keep a 5K entries is enough for helping | ||
// follower to catch up. | ||
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"` | ||
// Deprecated in v3.6 and will be removed in v3.7. | ||
// TODO: remove in v3.7. | ||
ExperimentalSnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"` | ||
|
||
// SnapshotCatchUpEntries is the number of entires for a slow follower | ||
// to catch-up after compacting the raft storage entries. | ||
// We expect the follower has a millisecond level latency with the leader. | ||
// The max throughput is around 10K. Keep a 5K entries is enough for helping | ||
// follower to catch up. | ||
SnapshotCatchUpEntries uint64 `json:"snapshot-catchup-entries"` | ||
|
||
// MaxSnapFiles is deprecated in v3.6 and will be decommissioned in v3.7. | ||
// TODO: remove it in 3.7. | ||
|
@@ -584,8 +594,9 @@ func NewConfig() *Config { | |
|
||
Name: DefaultName, | ||
|
||
SnapshotCount: etcdserver.DefaultSnapshotCount, | ||
SnapshotCatchUpEntries: etcdserver.DefaultSnapshotCatchUpEntries, | ||
SnapshotCount: etcdserver.DefaultSnapshotCount, | ||
ExperimentalSnapshotCatchUpEntries: etcdserver.DefaultSnapshotCatchUpEntries, | ||
SnapshotCatchUpEntries: etcdserver.DefaultSnapshotCatchUpEntries, | ||
|
||
MaxTxnOps: DefaultMaxTxnOps, | ||
MaxRequestBytes: DefaultMaxRequestBytes, | ||
|
@@ -876,7 +887,8 @@ func (cfg *Config) AddFlags(fs *flag.FlagSet) { | |
// TODO: delete in v3.7 | ||
fs.IntVar(&cfg.ExperimentalMaxLearners, "experimental-max-learners", membership.DefaultMaxLearners, "Sets the maximum number of learners that can be available in the cluster membership. Deprecated in v3.6 and will be decommissioned in v3.7. Use --max-learners instead.") | ||
fs.IntVar(&cfg.MaxLearners, "max-learners", membership.DefaultMaxLearners, "Sets the maximum number of learners that can be available in the cluster membership.") | ||
fs.Uint64Var(&cfg.SnapshotCatchUpEntries, "experimental-snapshot-catchup-entries", cfg.SnapshotCatchUpEntries, "Number of entries for a slow follower to catch up after compacting the raft storage entries.") | ||
fs.Uint64Var(&cfg.ExperimentalSnapshotCatchUpEntries, "experimental-snapshot-catchup-entries", cfg.ExperimentalSnapshotCatchUpEntries, "Number of entries for a slow follower to catch up after compacting the raft storage entries. Deprecated in v3.6 and will be decommissioned in v3.7. Use --snapshot-catchup-entries instead.") | ||
fs.Uint64Var(&cfg.SnapshotCatchUpEntries, "snapshot-catchup-entries", cfg.SnapshotCatchUpEntries, "Number of entries for a slow follower to catch up after compacting the raft storage entries.") | ||
|
||
// unsafe | ||
fs.BoolVar(&cfg.UnsafeNoFsync, "unsafe-no-fsync", false, "Disables fsync, unsafe, will cause data loss.") | ||
|
@@ -925,6 +937,15 @@ func (cfg *configYAML) configFromFile(path string) error { | |
cfg.FlagsExplicitlySet[flg] = true | ||
} | ||
|
||
// attempt to fix a bug introduced in https://github.com/etcd-io/etcd/pull/15033 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the catch. |
||
// both `experimental-snapshot-catch-up-entries` and `experimental-snapshot-catchup-entries` refer to the same field, | ||
// map the YAML field "experimental-snapshot-catch-up-entries" to the flag "experimental-snapshot-catchup-entries". | ||
if val, ok := cfgMap["experimental-snapshot-catch-up-entries"]; ok { | ||
cfgMap["experimental-snapshot-catchup-entries"] = val | ||
cfg.ExperimentalSnapshotCatchUpEntries = uint64(val.(float64)) | ||
cfg.FlagsExplicitlySet["experimental-snapshot-catchup-entries"] = true | ||
} | ||
|
||
getBoolFlagVal := func(flagName string) *bool { | ||
flagVal, ok := cfgMap[flagName] | ||
if !ok { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -229,7 +229,7 @@ func WithSnapshotCount(count uint64) EPClusterOption { | |||||
} | ||||||
|
||||||
func WithSnapshotCatchUpEntries(count uint64) EPClusterOption { | ||||||
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.SnapshotCatchUpEntries = count } | ||||||
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.ExperimentalSnapshotCatchUpEntries = count } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The e2e test failure of etcd/tests/robustness/failpoint/network.go Line 147 in 3db3468
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or it might be even better to set both etcd/tests/robustness/failpoint/network.go Line 147 in 3db3468
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your review, @ahrtr. I considered setting both the flags at test framework, but we explicitly disallow doing so (we validate for both flags being set), as that could allow misconfigurations in real world use-cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am aware of that setting both flags are disallowed, but what we are talking about here is just test code. Also note that the robustness test cases test both main and release branches, while |
||||||
} | ||||||
|
||||||
func WithClusterSize(size int) EPClusterOption { | ||||||
|
@@ -661,7 +661,7 @@ func (cfg *EtcdProcessClusterConfig) EtcdServerProcessConfig(tb testing.TB, i in | |||||
if defaultValue := defaultValues[flag]; value == "" || value == defaultValue { | ||||||
continue | ||||||
} | ||||||
if flag == "experimental-snapshot-catchup-entries" && !CouldSetSnapshotCatchupEntries(execPath) { | ||||||
if strings.HasSuffix(flag, "snapshot-catchup-entries") && !CouldSetSnapshotCatchupEntries(execPath) { | ||||||
continue | ||||||
} | ||||||
args = append(args, fmt.Sprintf("--%s=%s", flag, value)) | ||||||
|
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.
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.
Pls feel free to address this comment separately in
release-3.6
(will be be cut later today my time) only if you want