Skip to content

Commit ee5ef42

Browse files
committed
server: --enable-v2 and --enable-v2v3 is decomissioned
1 parent e0a0fdc commit ee5ef42

27 files changed

+69
-3333
lines changed

client/v2/example_keys_test.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

etcd.conf.yml.sample

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ initial-cluster-state: 'new'
6969
# Reject reconfiguration requests that would cause quorum loss.
7070
strict-reconfig-check: false
7171

72-
# Accept etcd V2 client requests
73-
enable-v2: true
74-
7572
# Enable runtime profiling data via HTTP server
7673
enable-pprof: true
7774

server/embed/config.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ const (
8686
// DefaultStrictReconfigCheck is the default value for "--strict-reconfig-check" flag.
8787
// It's enabled by default.
8888
DefaultStrictReconfigCheck = true
89-
// DefaultEnableV2 is the default value for "--enable-v2" flag.
90-
// v2 API is disabled by default.
91-
DefaultEnableV2 = false
9289

9390
// maxElectionMs specifies the maximum value of election timeout.
9491
// More details are listed in ../Documentation/tuning.md#time-parameters.
@@ -224,11 +221,6 @@ type Config struct {
224221
InitialClusterToken string `json:"initial-cluster-token"`
225222
StrictReconfigCheck bool `json:"strict-reconfig-check"`
226223

227-
// EnableV2 exposes the deprecated V2 API surface.
228-
// TODO: Delete in 3.6 (https://github.com/etcd-io/etcd/issues/12913)
229-
// Deprecated in 3.5.
230-
EnableV2 bool `json:"enable-v2"`
231-
232224
// AutoCompactionMode is either 'periodic' or 'revision'.
233225
AutoCompactionMode string `json:"auto-compaction-mode"`
234226
// AutoCompactionRetention is either duration string with time unit
@@ -311,10 +303,6 @@ type Config struct {
311303

312304
ExperimentalInitialCorruptCheck bool `json:"experimental-initial-corrupt-check"`
313305
ExperimentalCorruptCheckTime time.Duration `json:"experimental-corrupt-check-time"`
314-
// ExperimentalEnableV2V3 configures URLs that expose deprecated V2 API working on V3 store.
315-
// Deprecated in v3.5.
316-
// TODO: Delete in v3.6 (https://github.com/etcd-io/etcd/issues/12913)
317-
ExperimentalEnableV2V3 string `json:"experimental-enable-v2v3"`
318306
// ExperimentalEnableLeaseCheckpoint enables leader to send regular checkpoints to other members to prevent reset of remaining TTL on leader change.
319307
ExperimentalEnableLeaseCheckpoint bool `json:"experimental-enable-lease-checkpoint"`
320308
// ExperimentalEnableLeaseCheckpointPersist enables persisting remainingTTL to prevent indefinite auto-renewal of long lived leases. Always enabled in v3.6. Should be used to ensure smooth upgrade from v3.5 clusters with this feature enabled.
@@ -488,7 +476,6 @@ func NewConfig() *Config {
488476

489477
StrictReconfigCheck: DefaultStrictReconfigCheck,
490478
Metrics: "basic",
491-
EnableV2: DefaultEnableV2,
492479

493480
CORS: map[string]struct{}{"*": {}},
494481
HostWhitelist: map[string]struct{}{"*": {}},

server/embed/etcd.go

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ import (
3838
"go.etcd.io/etcd/server/v3/etcdserver"
3939
"go.etcd.io/etcd/server/v3/etcdserver/api/etcdhttp"
4040
"go.etcd.io/etcd/server/v3/etcdserver/api/rafthttp"
41-
"go.etcd.io/etcd/server/v3/etcdserver/api/v2http"
42-
"go.etcd.io/etcd/server/v3/etcdserver/api/v2v3"
43-
"go.etcd.io/etcd/server/v3/etcdserver/api/v3client"
4441
"go.etcd.io/etcd/server/v3/etcdserver/api/v3rpc"
4542
"go.etcd.io/etcd/server/v3/storage"
4643
"go.etcd.io/etcd/server/v3/verify"
@@ -695,25 +692,9 @@ func (e *Etcd) serveClients() (err error) {
695692
}
696693

697694
// Start a client server goroutine for each listen address
698-
var h http.Handler
699-
if e.Config().EnableV2 {
700-
if e.Config().V2DeprecationEffective().IsAtLeast(config.V2_DEPR_1_WRITE_ONLY) {
701-
return fmt.Errorf("--enable-v2 and --v2-deprecation=%s are mutually exclusive", e.Config().V2DeprecationEffective())
702-
}
703-
e.cfg.logger.Warn("Flag `enable-v2` is deprecated and will get removed in etcd 3.6.")
704-
if len(e.Config().ExperimentalEnableV2V3) > 0 {
705-
e.cfg.logger.Warn("Flag `experimental-enable-v2v3` is deprecated and will get removed in etcd 3.6.")
706-
srv := v2v3.NewServer(e.cfg.logger, v3client.New(e.Server), e.cfg.ExperimentalEnableV2V3)
707-
h = v2http.NewClientHandler(e.GetLogger(), srv, e.Server.Cfg.ReqTimeout())
708-
} else {
709-
h = v2http.NewClientHandler(e.GetLogger(), e.Server, e.Server.Cfg.ReqTimeout())
710-
}
711-
} else {
712-
mux := http.NewServeMux()
713-
etcdhttp.HandleBasic(e.cfg.logger, mux, e.Server)
714-
etcdhttp.HandleMetricsHealthForV3(e.cfg.logger, mux, e.Server)
715-
h = mux
716-
}
695+
mux := http.NewServeMux()
696+
etcdhttp.HandleBasic(e.cfg.logger, mux, e.Server)
697+
etcdhttp.HandleMetricsHealthForV3(e.cfg.logger, mux, e.Server)
717698

718699
gopts := []grpc.ServerOption{}
719700
if e.cfg.GRPCKeepAliveMinTime > time.Duration(0) {
@@ -733,7 +714,7 @@ func (e *Etcd) serveClients() (err error) {
733714
// start client servers in each goroutine
734715
for _, sctx := range e.sctxs {
735716
go func(s *serveCtx) {
736-
e.errHandler(s.serve(e.Server, &e.cfg.ClientTLSInfo, h, e.errHandler, gopts...))
717+
e.errHandler(s.serve(e.Server, &e.cfg.ClientTLSInfo, mux, e.errHandler, gopts...))
737718
}(sctx)
738719
}
739720
return nil

server/etcdmain/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ func newConfig() *config {
200200

201201
fs.BoolVar(&cfg.ec.PreVote, "pre-vote", cfg.ec.PreVote, "Enable to run an additional Raft election phase.")
202202

203-
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.")
204-
fs.StringVar(&cfg.ec.ExperimentalEnableV2V3, "experimental-enable-v2v3", cfg.ec.ExperimentalEnableV2V3, "v3 prefix for serving emulated v2 state. Deprecated in 3.5. Will be decommissioned in 3.6.")
205203
fs.Var(cfg.cf.v2deprecation, "v2-deprecation", fmt.Sprintf("v2store deprecation stage: %q. ", cfg.cf.proxy.Valids()))
206204

207205
// proxy

server/etcdmain/help.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ Clustering:
123123
Auto compaction retention length. 0 means disable auto compaction.
124124
--auto-compaction-mode 'periodic'
125125
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.
126-
--enable-v2 '` + strconv.FormatBool(embed.DefaultEnableV2) + `'
127-
Accept etcd V2 client requests. Deprecated and to be decommissioned in v3.6.
128126
--v2-deprecation '` + string(cconfig.V2_DEPR_DEFAULT) + `'
129127
Phase of v2store deprecation. Allows to opt-in for higher compatibility mode.
130128
Supported values:
@@ -234,8 +232,6 @@ Experimental feature:
234232
Enable to check data corruption before serving any client/peer traffic.
235233
--experimental-corrupt-check-time '0s'
236234
Duration of time between cluster corruption check passes.
237-
--experimental-enable-v2v3 ''
238-
Serve v2 requests through the v3 backend under a given prefix. Deprecated and to be decommissioned in v3.6.
239235
--experimental-enable-lease-checkpoint 'false'
240236
ExperimentalEnableLeaseCheckpoint enables primary lessor to persist lease remainingTTL to prevent indefinite auto-renewal of long lived leases.
241237
--experimental-compaction-batch-limit 1000

server/etcdserver/api/v2v3/cluster.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

server/etcdserver/api/v2v3/doc.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

server/etcdserver/api/v2v3/server.go

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)