-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Fix passing compaction-batch-limit to etcd v3.4 and v3.5 #19218
Open
serathius
wants to merge
1
commit into
etcd-io:main
Choose a base branch
from
serathius:fix-selecting-experimental-flag
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9
−16
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -376,10 +376,6 @@ func WithCompactionBatchLimit(limit int) EPClusterOption { | |
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.CompactionBatchLimit = limit } | ||
} | ||
|
||
func WithExperimentalCompactionBatchLimit(limit int) EPClusterOption { | ||
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.ExperimentalCompactionBatchLimit = limit } | ||
} | ||
|
||
func WithCompactionSleepInterval(time time.Duration) EPClusterOption { | ||
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.ExperimentalCompactionSleepInterval = time } | ||
} | ||
|
@@ -640,6 +636,9 @@ func (cfg *EtcdProcessClusterConfig) EtcdServerProcessConfig(tb testing.TB, i in | |
if flag == "experimental-snapshot-catchup-entries" && !CouldSetSnapshotCatchupEntries(execPath) { | ||
continue | ||
} | ||
if flag == "compaction-batch-limit" { | ||
flag = "experimental-compaction-batch-limit" | ||
} | ||
args = append(args, fmt.Sprintf("--%s=%s", flag, value)) | ||
} | ||
envVars := map[string]string{} | ||
|
@@ -881,16 +880,13 @@ func (epc *EtcdProcessCluster) StartNewProcFromConfig(ctx context.Context, tb te | |
|
||
// UpdateProcOptions updates the options for a specific process. If no opt is set, then the config is identical | ||
// to the cluster. | ||
func (epc *EtcdProcessCluster) UpdateProcOptions(i int, tb testing.TB, opts ...EPClusterOption) error { | ||
func (epc *EtcdProcessCluster) UpdateProcOptions(i int, tb testing.TB, newflags ...string) error { | ||
if epc.Procs[i].IsRunning() { | ||
return fmt.Errorf("process %d is still running, please close it before updating its options", i) | ||
} | ||
cfg := *epc.Cfg | ||
for _, opt := range opts { | ||
opt(&cfg) | ||
} | ||
Comment on lines
-889
to
-891
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. are you sure this won't cause any issue? 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. Don't know, but the idea of |
||
serverCfg := cfg.EtcdServerProcessConfig(tb, i) | ||
|
||
serverCfg.Args = append(serverCfg.Args, newflags...) | ||
var initialCluster []string | ||
for _, p := range epc.Procs { | ||
initialCluster = append(initialCluster, fmt.Sprintf("%s=%s", p.Config().Name, p.Config().PeerURL.String())) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
But it's still a little tricky. Starting from 3.7, we will remove the experimental flags. So
So we may need to check the binary version and decide to use which flag. It's better to get them wrapped in a separate function.
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.
The upgrade/downgrade robustness test can set this config, but will not update the flags before restart. We would need to rewrite the e2e framework to reload flags from config on every restart.
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.
It seems that we need to reconcile all the config items once we update the binary (i.e. from 3.6 to 3.5, or from 3.5 to 3.6)
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.
use the
experimentalNonBoolFlagMigrationMap
to map the flags in migration for now? It should work before we rewrite the framework functions.