mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Deprecate V2 API: --enable-v2 and v2v3
Flags `--experimental-enable-v2v3` and '-enable-v2' will raise a warning in 3.5, in 3.6 they are schedule for decomissioning, such that v2store can stop be written in 3.7. Deprecation plan in: https://github.com/etcd-io/etcd/issues/12913
This commit is contained in:
@@ -71,6 +71,8 @@ See [code changes](https://github.com/etcd-io/etcd/compare/v3.4.0...v3.5.0) and
|
|||||||
- [Embed Etcd.Close()](https://github.com/etcd-io/etcd/pull/12828) needs to called exactly once and closes Etcd.Err() stream.
|
- [Embed Etcd.Close()](https://github.com/etcd-io/etcd/pull/12828) needs to called exactly once and closes Etcd.Err() stream.
|
||||||
- [Embed Etcd does not override global/grpc logger](https://github.com/etcd-io/etcd/pull/12861) be default any longer. If desired, please call `embed.Config::SetupGlobalLoggers()` explicitly.
|
- [Embed Etcd does not override global/grpc logger](https://github.com/etcd-io/etcd/pull/12861) be default any longer. If desired, please call `embed.Config::SetupGlobalLoggers()` explicitly.
|
||||||
- Errors: `context cancelled` or `context deadline exceeded` are exposed as codes.Canceled, codes.DeadlineExceeded instead of 'codes.Unknown'.
|
- Errors: `context cancelled` or `context deadline exceeded` are exposed as codes.Canceled, codes.DeadlineExceeded instead of 'codes.Unknown'.
|
||||||
|
- Version 3.5 is the last version that supports V2 API. Flags `--enable-v2` and `--experimental-enable-v2v3` [are now deprecated](https://github.com/etcd-io/etcd/pull/)
|
||||||
|
and will be removed in etcd v3.6 release.
|
||||||
###
|
###
|
||||||
|
|
||||||
- Make sure [save snapshot downloads checksum for integrity checks](https://github.com/etcd-io/etcd/pull/11896).
|
- Make sure [save snapshot downloads checksum for integrity checks](https://github.com/etcd-io/etcd/pull/11896).
|
||||||
|
|||||||
@@ -222,6 +222,10 @@ type Config struct {
|
|||||||
InitialCluster string `json:"initial-cluster"`
|
InitialCluster string `json:"initial-cluster"`
|
||||||
InitialClusterToken string `json:"initial-cluster-token"`
|
InitialClusterToken string `json:"initial-cluster-token"`
|
||||||
StrictReconfigCheck bool `json:"strict-reconfig-check"`
|
StrictReconfigCheck bool `json:"strict-reconfig-check"`
|
||||||
|
|
||||||
|
// EnableV2 exposes the deprecated V2 API surface.
|
||||||
|
// TODO: Delete in 3.6 (https://github.com/etcd-io/etcd/issues/12913)
|
||||||
|
// Deprecated in 3.5.
|
||||||
EnableV2 bool `json:"enable-v2"`
|
EnableV2 bool `json:"enable-v2"`
|
||||||
|
|
||||||
// AutoCompactionMode is either 'periodic' or 'revision'.
|
// AutoCompactionMode is either 'periodic' or 'revision'.
|
||||||
@@ -306,6 +310,9 @@ type Config struct {
|
|||||||
|
|
||||||
ExperimentalInitialCorruptCheck bool `json:"experimental-initial-corrupt-check"`
|
ExperimentalInitialCorruptCheck bool `json:"experimental-initial-corrupt-check"`
|
||||||
ExperimentalCorruptCheckTime time.Duration `json:"experimental-corrupt-check-time"`
|
ExperimentalCorruptCheckTime time.Duration `json:"experimental-corrupt-check-time"`
|
||||||
|
// ExperimentalEnableV2V3 configures URLs that expose deprecated V2 API working on V3 store.
|
||||||
|
// Deprecated in v3.5.
|
||||||
|
// TODO: Delete in v3.6 (https://github.com/etcd-io/etcd/issues/12913)
|
||||||
ExperimentalEnableV2V3 string `json:"experimental-enable-v2v3"`
|
ExperimentalEnableV2V3 string `json:"experimental-enable-v2v3"`
|
||||||
// ExperimentalEnableLeaseCheckpoint enables primary lessor to persist lease remainingTTL to prevent indefinite auto-renewal of long lived leases.
|
// ExperimentalEnableLeaseCheckpoint enables primary lessor to persist lease remainingTTL to prevent indefinite auto-renewal of long lived leases.
|
||||||
ExperimentalEnableLeaseCheckpoint bool `json:"experimental-enable-lease-checkpoint"`
|
ExperimentalEnableLeaseCheckpoint bool `json:"experimental-enable-lease-checkpoint"`
|
||||||
|
|||||||
@@ -695,7 +695,9 @@ func (e *Etcd) serveClients() (err error) {
|
|||||||
// Start a client server goroutine for each listen address
|
// Start a client server goroutine for each listen address
|
||||||
var h http.Handler
|
var h http.Handler
|
||||||
if e.Config().EnableV2 {
|
if e.Config().EnableV2 {
|
||||||
|
e.cfg.logger.Warn("Flag `enable-v2` is deprecated and will get removed in etcd 3.6.")
|
||||||
if len(e.Config().ExperimentalEnableV2V3) > 0 {
|
if len(e.Config().ExperimentalEnableV2V3) > 0 {
|
||||||
|
e.cfg.logger.Warn("Flag `experimental-enable-v2v3` is deprecated and will get removed in etcd 3.6.")
|
||||||
srv := v2v3.NewServer(e.cfg.logger, v3client.New(e.Server), e.cfg.ExperimentalEnableV2V3)
|
srv := v2v3.NewServer(e.cfg.logger, v3client.New(e.Server), e.cfg.ExperimentalEnableV2V3)
|
||||||
h = v2http.NewClientHandler(e.GetLogger(), srv, e.Server.Cfg.ReqTimeout())
|
h = v2http.NewClientHandler(e.GetLogger(), srv, e.Server.Cfg.ReqTimeout())
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ func newConfig() *config {
|
|||||||
fs.Var(cfg.cf.clusterState, "initial-cluster-state", "Initial cluster state ('new' or 'existing').")
|
fs.Var(cfg.cf.clusterState, "initial-cluster-state", "Initial cluster state ('new' or 'existing').")
|
||||||
|
|
||||||
fs.BoolVar(&cfg.ec.StrictReconfigCheck, "strict-reconfig-check", cfg.ec.StrictReconfigCheck, "Reject reconfiguration requests that would cause quorum loss.")
|
fs.BoolVar(&cfg.ec.StrictReconfigCheck, "strict-reconfig-check", cfg.ec.StrictReconfigCheck, "Reject reconfiguration requests that would cause quorum loss.")
|
||||||
fs.BoolVar(&cfg.ec.EnableV2, "enable-v2", cfg.ec.EnableV2, "Accept etcd V2 client requests.")
|
fs.BoolVar(&cfg.ec.EnableV2, "enable-v2", cfg.ec.EnableV2, "Accept etcd V2 client requests. Deprecated in v3.5. Will be decommission in v3.6.")
|
||||||
fs.BoolVar(&cfg.ec.PreVote, "pre-vote", cfg.ec.PreVote, "Enable to run an additional Raft election phase.")
|
fs.BoolVar(&cfg.ec.PreVote, "pre-vote", cfg.ec.PreVote, "Enable to run an additional Raft election phase.")
|
||||||
|
|
||||||
// proxy
|
// proxy
|
||||||
@@ -268,7 +268,7 @@ func newConfig() *config {
|
|||||||
// experimental
|
// experimental
|
||||||
fs.BoolVar(&cfg.ec.ExperimentalInitialCorruptCheck, "experimental-initial-corrupt-check", cfg.ec.ExperimentalInitialCorruptCheck, "Enable to check data corruption before serving any client/peer traffic.")
|
fs.BoolVar(&cfg.ec.ExperimentalInitialCorruptCheck, "experimental-initial-corrupt-check", cfg.ec.ExperimentalInitialCorruptCheck, "Enable to check data corruption before serving any client/peer traffic.")
|
||||||
fs.DurationVar(&cfg.ec.ExperimentalCorruptCheckTime, "experimental-corrupt-check-time", cfg.ec.ExperimentalCorruptCheckTime, "Duration of time between cluster corruption check passes.")
|
fs.DurationVar(&cfg.ec.ExperimentalCorruptCheckTime, "experimental-corrupt-check-time", cfg.ec.ExperimentalCorruptCheckTime, "Duration of time between cluster corruption check passes.")
|
||||||
fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state.")
|
fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state. Deprecated in 3.5. Will be decomissioned in 3.6.")
|
||||||
fs.BoolVar(&cfg.ec.ExperimentalEnableLeaseCheckpoint, "experimental-enable-lease-checkpoint", false, "Enable to persist lease remaining TTL to prevent indefinite auto-renewal of long lived leases.")
|
fs.BoolVar(&cfg.ec.ExperimentalEnableLeaseCheckpoint, "experimental-enable-lease-checkpoint", false, "Enable to persist lease remaining TTL to prevent indefinite auto-renewal of long lived leases.")
|
||||||
fs.IntVar(&cfg.ec.ExperimentalCompactionBatchLimit, "experimental-compaction-batch-limit", cfg.ec.ExperimentalCompactionBatchLimit, "Sets the maximum revisions deleted in each compaction batch.")
|
fs.IntVar(&cfg.ec.ExperimentalCompactionBatchLimit, "experimental-compaction-batch-limit", cfg.ec.ExperimentalCompactionBatchLimit, "Sets the maximum revisions deleted in each compaction batch.")
|
||||||
fs.DurationVar(&cfg.ec.ExperimentalWatchProgressNotifyInterval, "experimental-watch-progress-notify-interval", cfg.ec.ExperimentalWatchProgressNotifyInterval, "Duration of periodic watch progress notifications.")
|
fs.DurationVar(&cfg.ec.ExperimentalWatchProgressNotifyInterval, "experimental-watch-progress-notify-interval", cfg.ec.ExperimentalWatchProgressNotifyInterval, "Duration of periodic watch progress notifications.")
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ Clustering:
|
|||||||
--auto-compaction-mode 'periodic'
|
--auto-compaction-mode 'periodic'
|
||||||
Interpret 'auto-compaction-retention' one of: periodic|revision. 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. '5m'). 'revision' for revision number based retention.
|
Interpret 'auto-compaction-retention' one of: periodic|revision. 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. '5m'). 'revision' for revision number based retention.
|
||||||
--enable-v2 '` + strconv.FormatBool(embed.DefaultEnableV2) + `'
|
--enable-v2 '` + strconv.FormatBool(embed.DefaultEnableV2) + `'
|
||||||
Accept etcd V2 client requests.
|
Accept etcd V2 client requests. Deprecated and to be decommissioned in v3.6.
|
||||||
|
|
||||||
Security:
|
Security:
|
||||||
--cert-file ''
|
--cert-file ''
|
||||||
@@ -203,7 +203,7 @@ Experimental distributed tracing:
|
|||||||
--experimental-distributed-tracing-instance-id ''
|
--experimental-distributed-tracing-instance-id ''
|
||||||
Distributed tracing instance ID, must be unique per each etcd instance.
|
Distributed tracing instance ID, must be unique per each etcd instance.
|
||||||
|
|
||||||
v2 Proxy (to be deprecated in v4):
|
v2 Proxy (to be deprecated in v3.6):
|
||||||
--proxy 'off'
|
--proxy 'off'
|
||||||
Proxy mode setting ('off', 'readonly' or 'on').
|
Proxy mode setting ('off', 'readonly' or 'on').
|
||||||
--proxy-failure-wait 5000
|
--proxy-failure-wait 5000
|
||||||
@@ -223,7 +223,7 @@ Experimental feature:
|
|||||||
--experimental-corrupt-check-time '0s'
|
--experimental-corrupt-check-time '0s'
|
||||||
Duration of time between cluster corruption check passes.
|
Duration of time between cluster corruption check passes.
|
||||||
--experimental-enable-v2v3 ''
|
--experimental-enable-v2v3 ''
|
||||||
Serve v2 requests through the v3 backend under a given prefix.
|
Serve v2 requests through the v3 backend under a given prefix. Deprecated and to be decommissioned in v3.6.
|
||||||
--experimental-enable-lease-checkpoint 'false'
|
--experimental-enable-lease-checkpoint 'false'
|
||||||
ExperimentalEnableLeaseCheckpoint enables primary lessor to persist lease remainingTTL to prevent indefinite auto-renewal of long lived leases.
|
ExperimentalEnableLeaseCheckpoint enables primary lessor to persist lease remainingTTL to prevent indefinite auto-renewal of long lived leases.
|
||||||
--experimental-compaction-batch-limit 1000
|
--experimental-compaction-batch-limit 1000
|
||||||
|
|||||||
Reference in New Issue
Block a user