Skip to content

Commit d7860e1

Browse files
authored
Merge pull request #19560 from k8s-infra-cherrypick-robot/cherry-pick-19555-to-release-3.6
[release-3.6] server: remove ExperimentalMaxLearners
2 parents 79dfce8 + 1f889bc commit d7860e1

File tree

4 files changed

+0
-82
lines changed

4 files changed

+0
-82
lines changed

server/embed/config.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ var (
154154
"experimental-watch-progress-notify-interval": "watch-progress-notify-interval",
155155
"experimental-warning-apply-duration": "warning-apply-duration",
156156
"experimental-bootstrap-defrag-threshold-megabytes": "bootstrap-defrag-threshold-megabytes",
157-
"experimental-max-learners": "max-learners",
158157
"experimental-memory-mlock": "memory-mlock",
159158
"experimental-snapshot-catchup-entries": "snapshot-catchup-entries",
160159
"experimental-compaction-sleep-interval": "compaction-sleep-interval",
@@ -469,10 +468,6 @@ type Config struct {
469468
// TODO: Delete in v3.7
470469
// Deprecated: Use WarningUnaryRequestDuration. Will be decommissioned in v3.7.
471470
ExperimentalWarningUnaryRequestDuration time.Duration `json:"experimental-warning-unary-request-duration"`
472-
// ExperimentalMaxLearners sets a limit to the number of learner members that can exist in the cluster membership.
473-
// TODO: Delete in v3.7
474-
// Deprecated: Use MaxLearners instead. Will be decommissioned in v3.7.
475-
ExperimentalMaxLearners int `json:"experimental-max-learners"`
476471
// MaxLearners sets a limit to the number of learner members that can exist in the cluster membership.
477472
MaxLearners int `json:"max-learners"`
478473

@@ -718,8 +713,6 @@ func NewConfig() *Config {
718713
ExperimentalMemoryMlock: false,
719714
ExperimentalStopGRPCServiceOnDefrag: false,
720715
MaxLearners: membership.DefaultMaxLearners,
721-
// TODO: delete in v3.7
722-
ExperimentalMaxLearners: membership.DefaultMaxLearners,
723716

724717
ExperimentalTxnModeWriteWithSharedBuffer: DefaultExperimentalTxnModeWriteWithSharedBuffer,
725718
ExperimentalDistributedTracingAddress: DefaultDistributedTracingAddress,
@@ -959,7 +952,6 @@ func (cfg *Config) AddFlags(fs *flag.FlagSet) {
959952
fs.UintVar(&cfg.ExperimentalBootstrapDefragThresholdMegabytes, "experimental-bootstrap-defrag-threshold-megabytes", 0, "Enable the defrag during etcd server bootstrap on condition that it will free at least the provided threshold of disk space. Needs to be set to non-zero value to take effect. It's deprecated, and will be decommissioned in v3.7. Use --bootstrap-defrag-threshold-megabytes instead.")
960953
fs.UintVar(&cfg.BootstrapDefragThresholdMegabytes, "bootstrap-defrag-threshold-megabytes", 0, "Enable the defrag during etcd server bootstrap on condition that it will free at least the provided threshold of disk space. Needs to be set to non-zero value to take effect.")
961954
// TODO: delete in v3.7
962-
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.")
963955
fs.IntVar(&cfg.MaxLearners, "max-learners", membership.DefaultMaxLearners, "Sets the maximum number of learners that can be available in the cluster membership.")
964956
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.")
965957
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.")

server/etcdmain/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ var (
7070
"experimental-watch-progress-notify-interval": "--experimental-watch-progress-notify-interval is deprecated in v3.6 and will be decommissioned in v3.7. Use '--watch-progress-notify-interval' instead.",
7171
"experimental-warning-apply-duration": "--experimental-warning-apply-duration is deprecated in v3.6 and will be decommissioned in v3.7. Use '--warning-apply-duration' instead.",
7272
"experimental-bootstrap-defrag-threshold-megabytes": "--experimental-bootstrap-defrag-threshold-megabytes is deprecated in v3.6 and will be decommissioned in v3.7. Use '--bootstrap-defrag-threshold-megabytes' instead.",
73-
"experimental-max-learners": "--experimental-max-learners is deprecated in v3.6 and will be decommissioned in v3.7. Use '--max-learners' instead.",
7473
"experimental-memory-mlock": "--experimental-memory-mlock is deprecated in v3.6 and will be decommissioned in v3.7. Use '--memory-mlock' instead.",
7574
"experimental-snapshot-catchup-entries": "--experimental-snapshot-catchup-entries is deprecated in v3.6 and will be decommissioned in v3.7. Use '--snapshot-catchup-entries' instead.",
7675
"experimental-compaction-sleep-interval": "--experimental-compaction-sleep-interval is deprecated in v3.6 and will be decommissioned in v3.7. Use 'compaction-sleep-interval' instead.",
@@ -212,10 +211,6 @@ func (cfg *config) parse(arguments []string) error {
212211
cfg.ec.PeerTLSInfo.SkipClientSANVerify = cfg.ec.ExperimentalPeerSkipClientSanVerification
213212
}
214213

215-
if cfg.ec.FlagsExplicitlySet["experimental-max-learners"] {
216-
cfg.ec.MaxLearners = cfg.ec.ExperimentalMaxLearners
217-
}
218-
219214
if cfg.ec.FlagsExplicitlySet["experimental-memory-mlock"] {
220215
cfg.ec.MemoryMlock = cfg.ec.ExperimentalMemoryMlock
221216
}

server/etcdmain/config_test.go

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,70 +1090,6 @@ func TestBootstrapDefragThresholdMegabytesFlagMigration(t *testing.T) {
10901090
}
10911091
}
10921092

1093-
// TestMaxLearnersFlagMigration tests the migration from
1094-
// --experimental-max-learners to --max-learners
1095-
// TODO: delete in v3.7
1096-
func TestMaxLearnersFlagMigration(t *testing.T) {
1097-
testCases := []struct {
1098-
name string
1099-
maxLearners int
1100-
experimentalMaxLearners int
1101-
expectErr bool
1102-
expectedMaxLearners int
1103-
}{
1104-
{
1105-
name: "cannot set both experimental flag and non experimental flag",
1106-
maxLearners: 1,
1107-
experimentalMaxLearners: 2,
1108-
expectErr: true,
1109-
},
1110-
{
1111-
name: "can set experimental flag",
1112-
experimentalMaxLearners: 2,
1113-
expectedMaxLearners: 2,
1114-
},
1115-
{
1116-
name: "can set non experimental flag",
1117-
maxLearners: 1,
1118-
expectedMaxLearners: 1,
1119-
},
1120-
}
1121-
for _, tc := range testCases {
1122-
t.Run(tc.name, func(t *testing.T) {
1123-
cmdLineArgs := []string{}
1124-
yc := struct {
1125-
ExperimentalMaxLearners int `json:"experimental-max-learners,omitempty"`
1126-
MaxLearners int `json:"max-learners,omitempty"`
1127-
}{}
1128-
1129-
if tc.maxLearners != 0 {
1130-
cmdLineArgs = append(cmdLineArgs, fmt.Sprintf("--max-learners=%d", tc.maxLearners))
1131-
yc.MaxLearners = tc.maxLearners
1132-
}
1133-
1134-
if tc.experimentalMaxLearners != 0 {
1135-
cmdLineArgs = append(cmdLineArgs, fmt.Sprintf("--experimental-max-learners=%d", tc.experimentalMaxLearners))
1136-
yc.ExperimentalMaxLearners = tc.experimentalMaxLearners
1137-
}
1138-
1139-
cfgFromCmdLine, errFromCmdLine, cfgFromFile, errFromFile := generateCfgsFromFileAndCmdLine(t, yc, cmdLineArgs)
1140-
1141-
if tc.expectErr {
1142-
if errFromCmdLine == nil || errFromFile == nil {
1143-
t.Fatal("expect parse error")
1144-
}
1145-
return
1146-
}
1147-
if errFromCmdLine != nil || errFromFile != nil {
1148-
t.Fatal("error parsing config")
1149-
}
1150-
1151-
require.Equal(t, tc.expectedMaxLearners, cfgFromCmdLine.ec.MaxLearners)
1152-
require.Equal(t, tc.expectedMaxLearners, cfgFromFile.ec.MaxLearners)
1153-
})
1154-
}
1155-
}
1156-
11571093
// TestMemoryMlockFlagMigration tests the migration from
11581094
// --experimental-memory-mlock to --memory-mlock
11591095
// TODO: delete in v3.7
@@ -1341,7 +1277,6 @@ func TestConfigFileDeprecatedOptions(t *testing.T) {
13411277
ExperimentalWatchProgressNotifyInterval time.Duration `json:"experimental-watch-progress-notify-interval,omitempty"`
13421278
ExperimentalWarningApplyDuration time.Duration `json:"experimental-warning-apply-duration,omitempty"`
13431279
ExperimentalBootstrapDefragThresholdMegabytes uint `json:"experimental-bootstrap-defrag-threshold-megabytes,omitempty"`
1344-
ExperimentalMaxLearners int `json:"experimental-max-learners,omitempty"`
13451280
ExperimentalSnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries,omitempty"`
13461281
ExperimentalCompactionSleepInterval time.Duration `json:"experimental-compaction-sleep-interval,omitempty"`
13471282
ExperimentalDowngradeCheckTime time.Duration `json:"experimental-downgrade-check-time,omitempty"`
@@ -1368,7 +1303,6 @@ func TestConfigFileDeprecatedOptions(t *testing.T) {
13681303
ExperimentalWatchProgressNotifyInterval: 3 * time.Minute,
13691304
ExperimentalWarningApplyDuration: 3 * time.Minute,
13701305
ExperimentalBootstrapDefragThresholdMegabytes: 100,
1371-
ExperimentalMaxLearners: 1,
13721306
ExperimentalSnapshotCatchUpEntries: 1000,
13731307
ExperimentalCompactionSleepInterval: 30 * time.Second,
13741308
ExperimentalDowngradeCheckTime: 1 * time.Minute,
@@ -1381,7 +1315,6 @@ func TestConfigFileDeprecatedOptions(t *testing.T) {
13811315
"experimental-watch-progress-notify-interval": {},
13821316
"experimental-warning-apply-duration": {},
13831317
"experimental-bootstrap-defrag-threshold-megabytes": {},
1384-
"experimental-max-learners": {},
13851318
"experimental-snapshot-catchup-entries": {},
13861319
"experimental-compaction-sleep-interval": {},
13871320
"experimental-downgrade-check-time": {},

server/etcdmain/help.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,6 @@ Experimental feature:
321321
Enable the defrag during etcd server bootstrap on condition that it will free at least the provided threshold of disk space. Needs to be set to non-zero value to take effect.
322322
--experimental-warning-unary-request-duration '300ms'
323323
Set time duration after which a warning is generated if a unary request takes more than this duration. Deprecated in v3.6 and will be decommissioned in v3.7. Use '--warning-unary-request-duration' instead.
324-
--experimental-max-learners '1'
325-
Set the max number of learner members allowed in the cluster membership. Deprecated in v3.6 and will be decommissioned in v3.7. Use '--max-learners' instead.
326324
--max-learners '1'
327325
Set the max number of learner members allowed in the cluster membership.
328326
--experimental-snapshot-catch-up-entries '5000'

0 commit comments

Comments
 (0)