From cb3a15a2dc58c56623b0daae8a1d8286438e7a64 Mon Sep 17 00:00:00 2001 From: deepthi Date: Thu, 6 Jan 2022 16:12:08 -0800 Subject: [PATCH 1/4] deprecate and ignore gateway_implementation flag Signed-off-by: deepthi --- go/vt/vtgate/gateway.go | 4 ++-- go/vt/vtgate/tabletgateway.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go/vt/vtgate/gateway.go b/go/vt/vtgate/gateway.go index 5d69df742a0..35c84d384be 100644 --- a/go/vt/vtgate/gateway.go +++ b/go/vt/vtgate/gateway.go @@ -35,8 +35,8 @@ import ( // a query targeted to a keyspace/shard/tablet_type and send it off. var ( - // GatewayImplementation allows you to choose which gateway to use for vtgate routing. Defaults to tabletgateway, other option is discoverygateway - GatewayImplementation = flag.String("gateway_implementation", "tabletgateway", "Allowed values: discoverygateway (deprecated), tabletgateway (default)") + _ = flag.String("gateway_implementation", "", "Deprecated. Only tabletgateway is now supported, discoverygateway is no longer available") + GatewayImplementation = new(string) bufferImplementation = flag.String("buffer_implementation", "keyspace_events", "Allowed values: healthcheck (legacy implementation), keyspace_events (default)") initialTabletTimeout = flag.Duration("gateway_initial_tablet_timeout", 30*time.Second, "At startup, the gateway will wait up to that duration to get one tablet per keyspace/shard/tablettype") // RetryCount is the number of times a query will be retried on error diff --git a/go/vt/vtgate/tabletgateway.go b/go/vt/vtgate/tabletgateway.go index 49a6bc01dec..6f92f44691f 100644 --- a/go/vt/vtgate/tabletgateway.go +++ b/go/vt/vtgate/tabletgateway.go @@ -46,6 +46,7 @@ const ( ) func init() { + *GatewayImplementation = tabletGatewayImplementation RegisterGatewayCreator(tabletGatewayImplementation, createTabletGateway) } From dd40ff5f3ba56b5e992082dd78e7b822e21f9b85 Mon Sep 17 00:00:00 2001 From: deepthi Date: Thu, 6 Jan 2022 16:17:18 -0800 Subject: [PATCH 2/4] add release note Signed-off-by: deepthi --- doc/releasenotes/13_0_0_summary.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/releasenotes/13_0_0_summary.md b/doc/releasenotes/13_0_0_summary.md index 674baef1ac4..c8025de7d4e 100644 --- a/doc/releasenotes/13_0_0_summary.md +++ b/doc/releasenotes/13_0_0_summary.md @@ -4,6 +4,9 @@ ## Major Changes +### vtgate -gateway_implementation flag is deprecated (and ignored) +Support for `discoverygateway` is being dropped. `tabletgateway` is now the only supported implementation. Scripts using this flag should be updated to remove the flag as it will be deleted in the next release. + ### vttablet -use_super_read_only flag now defaults to true The default value used to be false. What this means is that during a failover, we will set `super_read_only` on database flavors that support them (MySQL 5.7+ and Percona 5.7+). In addition, all Vitess-managed databases will be started with `super-read-only` in the cnf file. From cecdfdaea39988aaa4ee8aa0f52fc708b333f9cb Mon Sep 17 00:00:00 2001 From: deepthi Date: Wed, 12 Jan 2022 10:34:46 -0800 Subject: [PATCH 3/4] ignore gateway_implementation flag without using init Signed-off-by: deepthi --- go/vt/vtgate/gateway.go | 10 ++++++---- go/vt/vtgate/tabletgateway.go | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go/vt/vtgate/gateway.go b/go/vt/vtgate/gateway.go index 35c84d384be..8d4b5e8b8a1 100644 --- a/go/vt/vtgate/gateway.go +++ b/go/vt/vtgate/gateway.go @@ -35,10 +35,12 @@ import ( // a query targeted to a keyspace/shard/tablet_type and send it off. var ( - _ = flag.String("gateway_implementation", "", "Deprecated. Only tabletgateway is now supported, discoverygateway is no longer available") - GatewayImplementation = new(string) - bufferImplementation = flag.String("buffer_implementation", "keyspace_events", "Allowed values: healthcheck (legacy implementation), keyspace_events (default)") - initialTabletTimeout = flag.Duration("gateway_initial_tablet_timeout", 30*time.Second, "At startup, the gateway will wait up to that duration to get one tablet per keyspace/shard/tablettype") + _ = flag.String("gateway_implementation", "", "Deprecated. Only tabletgateway is now supported, discoverygateway is no longer available") + // We cannot reference tabletGatewayImplementation directly because it is const + DefaultGatewayImplementation = tabletGatewayImplementation + GatewayImplementation = &DefaultGatewayImplementation + bufferImplementation = flag.String("buffer_implementation", "keyspace_events", "Allowed values: healthcheck (legacy implementation), keyspace_events (default)") + initialTabletTimeout = flag.Duration("gateway_initial_tablet_timeout", 30*time.Second, "At startup, the gateway will wait up to that duration to get one tablet per keyspace/shard/tablettype") // RetryCount is the number of times a query will be retried on error // Make this unexported after DiscoveryGateway is deprecated RetryCount = flag.Int("retry-count", 2, "retry count") diff --git a/go/vt/vtgate/tabletgateway.go b/go/vt/vtgate/tabletgateway.go index 6f92f44691f..49a6bc01dec 100644 --- a/go/vt/vtgate/tabletgateway.go +++ b/go/vt/vtgate/tabletgateway.go @@ -46,7 +46,6 @@ const ( ) func init() { - *GatewayImplementation = tabletGatewayImplementation RegisterGatewayCreator(tabletGatewayImplementation, createTabletGateway) } From e9caecd7b25ff55b3e9876616f6eee2e80b65d4d Mon Sep 17 00:00:00 2001 From: deepthi Date: Wed, 12 Jan 2022 10:37:00 -0800 Subject: [PATCH 4/4] fix scope for variable that was unintentionally exported Signed-off-by: deepthi --- go/vt/vtgate/gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/vt/vtgate/gateway.go b/go/vt/vtgate/gateway.go index 8d4b5e8b8a1..dc899cc6550 100644 --- a/go/vt/vtgate/gateway.go +++ b/go/vt/vtgate/gateway.go @@ -37,8 +37,8 @@ import ( var ( _ = flag.String("gateway_implementation", "", "Deprecated. Only tabletgateway is now supported, discoverygateway is no longer available") // We cannot reference tabletGatewayImplementation directly because it is const - DefaultGatewayImplementation = tabletGatewayImplementation - GatewayImplementation = &DefaultGatewayImplementation + defaultGatewayImplementation = tabletGatewayImplementation + GatewayImplementation = &defaultGatewayImplementation bufferImplementation = flag.String("buffer_implementation", "keyspace_events", "Allowed values: healthcheck (legacy implementation), keyspace_events (default)") initialTabletTimeout = flag.Duration("gateway_initial_tablet_timeout", 30*time.Second, "At startup, the gateway will wait up to that duration to get one tablet per keyspace/shard/tablettype") // RetryCount is the number of times a query will be retried on error