Skip to content
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

Mark --max-snapshots as deprecated in 3.6 and will be decommissioned … #19036

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion server/embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ type Config struct {
// follower to catch up.
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`

// MaxSnapFiles is deprecated in v3.6 and will be decommissioned in v3.7.
// TODO: remove it in 3.7.
MaxSnapFiles uint `json:"max-snapshots"`
//revive:disable-next-line:var-naming
MaxWalFiles uint `json:"max-wals"`
Expand Down Expand Up @@ -617,7 +619,7 @@ func (cfg *Config) AddFlags(fs *flag.FlagSet) {
"listen-metrics-urls",
"List of URLs to listen on for the metrics and health endpoints.",
)
fs.UintVar(&cfg.MaxSnapFiles, "max-snapshots", cfg.MaxSnapFiles, "Maximum number of snapshot files to retain (0 is unlimited).")
fs.UintVar(&cfg.MaxSnapFiles, "max-snapshots", cfg.MaxSnapFiles, "Maximum number of snapshot files to retain (0 is unlimited). Deprecated in v3.6 and will be decommissioned in v3.7.")
fs.UintVar(&cfg.MaxWalFiles, "max-wals", cfg.MaxWalFiles, "Maximum number of wal files to retain (0 is unlimited).")
fs.StringVar(&cfg.Name, "name", cfg.Name, "Human-readable name for this member.")
fs.Uint64Var(&cfg.SnapshotCount, "snapshot-count", cfg.SnapshotCount, "Number of committed transactions to trigger a snapshot to disk. Deprecated in v3.6 and will be decommissioned in v3.7.")
Expand Down
1 change: 1 addition & 0 deletions server/etcdmain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var (
deprecatedFlags = map[string]string{
// TODO: remove in 3.7.
"snapshot-count": "--snapshot-count is deprecated in 3.6 and will be decommissioned in 3.7.",
"max-snapshots": "--max-snapshots is deprecated in 3.6 and will be decommissioned in 3.7.",
"v2-deprecation": "--v2-deprecation is deprecated and scheduled for removal in v3.8. The default value is enforced, ignoring user input.",
}
)
Expand Down
2 changes: 1 addition & 1 deletion server/etcdmain/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Member:
--listen-client-http-urls ''
List of URLs to listen on for http only client traffic. Enabling this flag removes http services from --listen-client-urls.
--max-snapshots '` + strconv.Itoa(embed.DefaultMaxSnapshots) + `'
Maximum number of snapshot files to retain (0 is unlimited).
Maximum number of snapshot files to retain (0 is unlimited). Deprecated in v3.6 and will be decommissioned in v3.7.
--max-wals '` + strconv.Itoa(embed.DefaultMaxWALs) + `'
Maximum number of wal files to retain (0 is unlimited).
--quota-backend-bytes '0'
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/etcd_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,11 @@ func TestEtcdDeprecatedFlags(t *testing.T) {
args: append(commonArgs, "--snapshot-count=100"),
expectedMsg: "--snapshot-count is deprecated in 3.6 and will be decommissioned in 3.7",
},
{
name: "max-snapshots",
args: append(commonArgs, "--max-snapshots=10"),
expectedMsg: "--max-snapshots is deprecated in 3.6 and will be decommissioned in 3.7",
},
{
name: "v2-deprecation",
args: append(commonArgs, "--v2-deprecation", "write-only-drop-data"),
Expand Down
Loading