Repository: vitessio/vitess
Pull request #11522 (2022-10-18 01:41:28)

Removing redundant flags across binaries
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

## Description

During the audit of pflags across the binaries, we have found some redundancies. This PR 

- Remove redundant flags across binaries
- Add MarkDeprecated to flags which are going to be deleted in future release

## Related Issue(s)

https://github.com/rohit-nayak-ps/vreplication-docs/pull/2

## Checklist

-   [ ] "Backport me!" label has been added if this change should be backported
-   [x] Tests were added or are not required
-   [x] Documentation was added or is not required

## Deployment Notes

<!-- Notes regarding deployment of the contained body of work. These should note any db migrations, etc. -->


vitess-bot[bot]: ### Review Checklist
            
Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.

#### General
- [ ] Ensure that the Pull Request has a descriptive title.
- [ ] If this is a change that users need to know about, please apply the `release notes (needs details)` label so that merging is blocked unless the summary release notes document is included.

#### If a new flag is being introduced:
- [ ] Is it really necessary to add this flag?
- [ ] Flag names should be clear and intuitive (as far as possible)
- [ ] Help text should be descriptive.
- [ ] Flag names should use dashes (`-`) as word separators rather than underscores (`_`).

#### If a workflow is added or modified:
- [ ] Each item in `Jobs` should be named in order to mark it as `required`.
- [ ] If the workflow should be required, the maintainer team should be notified.

#### Bug fixes
- [ ] There should be at least one unit or end-to-end test.
- [ ] The Pull Request description should include a link to an issue that describes the bug.

#### Non-trivial changes
- [ ] There should be some code comments as to why things are implemented the way they are.

#### New/Existing features
- [ ] Should be documented, either by modifying the existing documentation or creating new documentation.
- [ ] New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.

#### Backward compatibility            
- [ ] Protobuf changes should be wire-compatible.
- [ ] Changes to `_vt` tables and RPCs need to be backward compatible.
- [ ] `vtctl` command output order should be stable and `awk`-able.
- [ ] RPC changes should be compatible with vitess-operator
- [ ] If a flag is removed, then it should also be removed from VTop, if used there.


Patch:
diff --git a/examples/local/vtadmin/discovery.json b/examples/local/vtadmin/discovery.json
index def7dd50f8..92e20fb40d 100644
--- a/examples/local/vtadmin/discovery.json
+++ b/examples/local/vtadmin/discovery.json
@@ -10,6 +10,7 @@
     "vtgates": [
         {
             "host": {
+                "fqdn": "localhost:15001",
                 "hostname": "localhost:15991"
             }
         }
diff --git a/examples/operator/101_initial_cluster.yaml b/examples/operator/101_initial_cluster.yaml
index 0a375ec040..557e07f4f8 100644
--- a/examples/operator/101_initial_cluster.yaml
+++ b/examples/operator/101_initial_cluster.yaml
@@ -9,7 +9,7 @@ metadata:
 spec:
   images:
     vtctld: vitess/lite:v15.0.0-rc1
-    vtadmin: vitess/vtadmin:latest
+    vtadmin: vitess/vtadmin:v15.0.0-rc1
     vtgate: vitess/lite:v15.0.0-rc1
     vttablet: vitess/lite:v15.0.0-rc1
     vtbackup: vitess/lite:v15.0.0-rc1
@@ -72,15 +72,14 @@ spec:
     durabilityPolicy: none
     turndownPolicy: Immediate
     vitessOrchestrator:
-      configSecret:
-        name: example-cluster-config
-        key: orc_config.json
       resources:
         limits:
           memory: 128Mi
         requests:
           cpu: 100m
           memory: 128Mi
+      extraFlags:
+        recovery-period-block-duration: 5s
     partitionings:
     - equal:
         parts: 1
@@ -242,12 +241,3 @@ stringData:
       subjects: ["*"]
       clusters:
         - "local"
-  orc_config.json: |
-    {
-      "Debug": true,
-      "MySQLTopologyUser": "orc_client_user",
-      "MySQLTopologyPassword": "orc_client_user_password",
-      "MySQLReplicaUser": "vt_repl",
-      "MySQLReplicaPassword": "",
-      "RecoveryPeriodBlockSeconds": 5
-    }
diff --git a/examples/operator/201_customer_tablets.yaml b/examples/operator/201_customer_tablets.yaml
index b5c2761ed6..e28270fb60 100644
--- a/examples/operator/201_customer_tablets.yaml
+++ b/examples/operator/201_customer_tablets.yaml
@@ -5,7 +5,7 @@ metadata:
 spec:
   images:
     vtctld: vitess/lite:v15.0.0-rc1
-    vtadmin: vitess/vtadmin:latest
+    vtadmin: vitess/vtadmin:v15.0.0-rc1
     vtgate: vitess/lite:v15.0.0-rc1
     vttablet: vitess/lite:v15.0.0-rc1
     vtbackup: vitess/lite:v15.0.0-rc1
@@ -68,15 +68,14 @@ spec:
     durabilityPolicy: none
     turndownPolicy: Immediate
     vitessOrchestrator:
-      configSecret:
-        name: example-cluster-config
-        key: orc_config.json
       resources:
         limits:
           memory: 128Mi
         requests:
           cpu: 100m
           memory: 128Mi
+      extraFlags:
+        recovery-period-block-duration: 5s
     partitionings:
     - equal:
         parts: 1
diff --git a/examples/operator/302_new_shards.yaml b/examples/operator/302_new_shards.yaml
index 84fb9e6610..a3b055c28f 100644
--- a/examples/operator/302_new_shards.yaml
+++ b/examples/operator/302_new_shards.yaml
@@ -5,7 +5,7 @@ metadata:
 spec:
   images:
     vtctld: vitess/lite:v15.0.0-rc1
-    vtadmin: vitess/vtadmin:latest
+    vtadmin: vitess/vtadmin:v15.0.0-rc1
     vtgate: vitess/lite:v15.0.0-rc1
     vttablet: vitess/lite:v15.0.0-rc1
     vtbackup: vitess/lite:v15.0.0-rc1
@@ -68,15 +68,14 @@ spec:
     durabilityPolicy: none
     turndownPolicy: Immediate
     vitessOrchestrator:
-      configSecret:
-        name: example-cluster-config
-        key: orc_config.json
       resources:
         limits:
           memory: 128Mi
         requests:
           cpu: 100m
           memory: 128Mi
+      extraFlags:
+        recovery-period-block-duration: 5s
     partitionings:
     - equal:
         parts: 1
diff --git a/examples/operator/306_down_shard_0.yaml b/examples/operator/306_down_shard_0.yaml
index 6d49bc6ab9..c3f3bb856d 100644
--- a/examples/operator/306_down_shard_0.yaml
+++ b/examples/operator/306_down_shard_0.yaml
@@ -5,7 +5,7 @@ metadata:
 spec:
   images:
     vtctld: vitess/lite:v15.0.0-rc1
-    vtadmin: vitess/vtadmin:latest
+    vtadmin: vitess/vtadmin:v15.0.0-rc1
     vtgate: vitess/lite:v15.0.0-rc1
     vttablet: vitess/lite:v15.0.0-rc1
     vtbackup: vitess/lite:v15.0.0-rc1
@@ -68,15 +68,14 @@ spec:
     durabilityPolicy: none
     turndownPolicy: Immediate
     vitessOrchestrator:
-      configSecret:
-        name: example-cluster-config
-        key: orc_config.json
       resources:
         limits:
           memory: 128Mi
         requests:
           cpu: 100m
           memory: 128Mi
+      extraFlags:
+        recovery-period-block-duration: 5s
     partitionings:
     - equal:
         parts: 1
diff --git a/examples/operator/operator.yaml b/examples/operator/operator.yaml
index a3bda99723..aaa86c7fd8 100644
--- a/examples/operator/operator.yaml
+++ b/examples/operator/operator.yaml
@@ -2450,6 +2450,7 @@ spec:
                               properties:
                                 parts:
                                   format: int32
+                                  maximum: 65536
                                   minimum: 1
                                   type: integer
                                 shardTemplate:
@@ -2801,17 +2802,6 @@ spec:
                             additionalProperties:
                               type: string
                             type: object
-                          configSecret:
-                            properties:
-                              key:
-                                type: string
-                              name:
-                                type: string
-                              volumeName:
-                                type: string
-                            required:
-                              - key
-                            type: object
                           extraEnv:
                             items:
                               properties:
@@ -2936,8 +2926,6 @@ spec:
                             x-kubernetes-preserve-unknown-fields: true
                           tolerations:
                             x-kubernetes-preserve-unknown-fields: true
-                        required:
-                          - configSecret
                         type: object
                     required:
                       - name
@@ -4002,6 +3990,7 @@ spec:
                         properties:
                           parts:
                             format: int32
+                            maximum: 65536
                             minimum: 1
                             type: integer
                           shardTemplate:
@@ -4387,17 +4376,6 @@ spec:
                       additionalProperties:
                         type: string
                       type: object
-                    configSecret:
-                      properties:
-                        key:
-                          type: string
-                        name:
-                          type: string
-                        volumeName:
-                          type: string
-                      required:
-                        - key
-                      type: object
                     extraEnv:
                       items:
                         properties:
@@ -4522,8 +4500,6 @@ spec:
                       x-kubernetes-preserve-unknown-fields: true
                     tolerations:
                       x-kubernetes-preserve-unknown-fields: true
-                  required:
-                    - configSecret
                   type: object
                 zoneMap:
                   additionalProperties:
@@ -5258,17 +5234,6 @@ spec:
                       additionalProperties:
                         type: string
                       type: object
-                    configSecret:
-                      properties:
-                        key:
-                          type: string
-                        name:
-                          type: string
-                        volumeName:
-                          type: string
-                      required:
-                        - key
-                      type: object
                     extraEnv:
                       items:
                         properties:
@@ -5393,8 +5358,6 @@ spec:
                       x-kubernetes-preserve-unknown-fields: true
                     tolerations:
                       x-kubernetes-preserve-unknown-fields: true
-                  required:
-                    - configSecret
                   type: object
                 zoneMap:
                   additionalProperties:
@@ -5656,7 +5619,7 @@ spec:
           name: vitess-operator
           resources:
             limits:
-              memory: 128Mi
+              memory: 512Mi
             requests:
               cpu: 100m
               memory: 128Mi
diff --git a/examples/region_sharding/vtadmin/discovery.json b/examples/region_sharding/vtadmin/discovery.json
index def7dd50f8..92e20fb40d 100644
--- a/examples/region_sharding/vtadmin/discovery.json
+++ b/examples/region_sharding/vtadmin/discovery.json
@@ -10,6 +10,7 @@
     "vtgates": [
         {
             "host": {
+                "fqdn": "localhost:15001",
                 "hostname": "localhost:15991"
             }
         }
diff --git a/go/cmd/vtgate/vtgate.go b/go/cmd/vtgate/vtgate.go
index 04c8b53a8d..d043ecf4f9 100644
--- a/go/cmd/vtgate/vtgate.go
+++ b/go/cmd/vtgate/vtgate.go
@@ -40,13 +40,14 @@ import (
 )
 
 var (
-	cell                           = ""
-	tabletTypesToWait, plannerName string
+	cell              = ""
+	tabletTypesToWait []topodatapb.TabletType
+	plannerName       string
 )
 
 func registerFlags(fs *pflag.FlagSet) {
 	fs.StringVar(&cell, "cell", cell, "cell to use")
-	fs.StringVar(&tabletTypesToWait, "tablet_types_to_wait", tabletTypesToWait, "wait till connected for specified tablet types during Gateway initialization")
+	fs.Var((*topoproto.TabletTypeListFlag)(&tabletTypesToWait), "tablet_types_to_wait", "Wait till connected for specified tablet types during Gateway initialization. Should be provided as a comma-separated set of tablet types.")
 	fs.StringVar(&plannerName, "planner-version", plannerName, "Sets the default planner to use when the session has not changed it. Valid values are: V3, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails.")
 
 	acl.RegisterFlags(fs)
@@ -133,12 +134,7 @@ func main() {
 
 	tabletTypes := make([]topodatapb.TabletType, 0, 1)
 	if len(tabletTypesToWait) != 0 {
-		for _, ttStr := range strings.Split(tabletTypesToWait, ",") {
-			tt, err := topoproto.ParseTabletType(ttStr)
-			if err != nil {
-				log.Errorf("unknown tablet type: %v", ttStr)
-				continue
-			}
+		for _, tt := range tabletTypesToWait {
 			if topoproto.IsServingType(tt) {
 				tabletTypes = append(tabletTypes, tt)
 			}
diff --git a/go/flags/endtoend/mysqlctl.txt b/go/flags/endtoend/mysqlctl.txt
index 362314def9..6444c8f457 100644
--- a/go/flags/endtoend/mysqlctl.txt
+++ b/go/flags/endtoend/mysqlctl.txt
@@ -14,15 +14,7 @@ Global flags:
       --alsologtostderr                                 log to standard error as well as files
       --app_idle_timeout duration                       Idle timeout for app connections (default 1m0s)
       --app_pool_size int                               Size of the connection pool for app connections (default 40)
-      --backup_engine_implementation string             Specifies which implementation to use for creating new backups (builtin or xtrabackup). Restores will always be done with whichever engine created a given backup. (default "builtin")
-      --backup_storage_block_size int                   if backup_storage_compress is true, backup_storage_block_size sets the byte size for each block while compressing (default is 250000). (default 250000)
-      --backup_storage_compress                         if set, the backup files will be compressed (default is true). Set to false for instance if a backup_storage_hook is specified and it compresses the data. (default true)
-      --backup_storage_number_blocks int                if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, at once, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2)
-      --builtinbackup_mysqld_timeout duration           how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s)
-      --builtinbackup_progress duration                 how often to send progress updates when backing up large files. (default 5s)
       --catch-sigpipe                                   catch and ignore SIGPIPE on stdout and stderr if specified
-      --compression-engine-name string                  compressor engine used for compression. (default "pargzip")
-      --compression-level int                           what level to pass to the compressor. (default 1)
       --db-credentials-file string                      db credentials file; send SIGHUP to reload this file
       --db-credentials-server string                    db credentials server type ('file' - file implementation; 'vault' - HashiCorp Vault implementation) (default "file")
       --db-credentials-vault-addr string                URL to Vault server
@@ -54,10 +46,6 @@ Global flags:
       --db_tls_min_version string                       Configures the minimal TLS version negotiated when SSL is enabled. Defaults to TLSv1.2. Options: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3.
       --dba_idle_timeout duration                       Idle timeout for dba connections (default 1m0s)
       --dba_pool_size int                               Size of the connection pool for dba connections (default 20)
-      --disable_active_reparents                        if set, do not allow active reparents. Use this to protect a cluster using external reparents.
-      --external-compressor string                      command with arguments to use when compressing a backup.
-      --external-compressor-extension string            extension to use when using an external compressor.
-      --external-decompressor string                    command with arguments to use when decompressing a backup.
       --grpc_auth_static_client_creds string            When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.
       --grpc_compression string                         Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy
       --grpc_initial_conn_window_size int               gRPC initial connection window size
@@ -96,11 +84,3 @@ Global flags:
       --v Level                                         log level for V logs
   -v, --version                                         print binary version
       --vmodule moduleSpec                              comma-separated list of pattern=N settings for file-filtered logging
-      --xbstream_restore_flags string                   flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
-      --xtrabackup_backup_flags string                  flags to pass to backup command. These should be space separated and will be added to the end of the command
-      --xtrabackup_prepare_flags string                 flags to pass to prepare command. These should be space separated and will be added to the end of the command
-      --xtrabackup_root_path string                     directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
-      --xtrabackup_stream_mode string                   which mode to use if streaming, valid values are tar and xbstream (default "tar")
-      --xtrabackup_stripe_block_size uint               Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
-      --xtrabackup_stripes uint                         If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
-      --xtrabackup_user string                          User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.
diff --git a/go/flags/endtoend/mysqlctld.txt b/go/flags/endtoend/mysqlctld.txt
index 7fe567ee77..f34697b39e 100644
--- a/go/flags/endtoend/mysqlctld.txt
+++ b/go/flags/endtoend/mysqlctld.txt
@@ -2,15 +2,7 @@ Usage of mysqlctld:
       --alsologtostderr                                                  log to standard error as well as files
       --app_idle_timeout duration                                        Idle timeout for app connections (default 1m0s)
       --app_pool_size int                                                Size of the connection pool for app connections (default 40)
-      --backup_engine_implementation string                              Specifies which implementation to use for creating new backups (builtin or xtrabackup). Restores will always be done with whichever engine created a given backup. (default "builtin")
-      --backup_storage_block_size int                                    if backup_storage_compress is true, backup_storage_block_size sets the byte size for each block while compressing (default is 250000). (default 250000)
-      --backup_storage_compress                                          if set, the backup files will be compressed (default is true). Set to false for instance if a backup_storage_hook is specified and it compresses the data. (default true)
-      --backup_storage_number_blocks int                                 if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, at once, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2)
-      --builtinbackup_mysqld_timeout duration                            how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s)
-      --builtinbackup_progress duration                                  how often to send progress updates when backing up large files. (default 5s)
       --catch-sigpipe                                                    catch and ignore SIGPIPE on stdout and stderr if specified
-      --compression-engine-name string                                   compressor engine used for compression. (default "pargzip")
-      --compression-level int                                            what level to pass to the compressor. (default 1)
       --db-credentials-file string                                       db credentials file; send SIGHUP to reload this file
       --db-credentials-server string                                     db credentials server type ('file' - file implementation; 'vault' - HashiCorp Vault implementation) (default "file")
       --db-credentials-vault-addr string                                 URL to Vault server
@@ -42,10 +34,6 @@ Usage of mysqlctld:
       --db_tls_min_version string                                        Configures the minimal TLS version negotiated when SSL is enabled. Defaults to TLSv1.2. Options: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3.
       --dba_idle_timeout duration                                        Idle timeout for dba connections (default 1m0s)
       --dba_pool_size int                                                Size of the connection pool for dba connections (default 20)
-      --disable_active_reparents                                         if set, do not allow active reparents. Use this to protect a cluster using external reparents.
-      --external-compressor string                                       command with arguments to use when compressing a backup.
-      --external-compressor-extension string                             extension to use when using an external compressor.
-      --external-decompressor string                                     command with arguments to use when decompressing a backup.
       --grpc_auth_mode string                                            Which auth plugin implementation to use (eg: static)
       --grpc_auth_mtls_allowed_substrings string                         List of substrings of at least one of the client certificate names (separated by colon).
       --grpc_auth_static_client_creds string                             When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.
@@ -101,11 +89,3 @@ Usage of mysqlctld:
   -v, --version                                                          print binary version
       --vmodule moduleSpec                                               comma-separated list of pattern=N settings for file-filtered logging
       --wait_time duration                                               How long to wait for mysqld startup or shutdown (default 5m0s)
-      --xbstream_restore_flags string                                    flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
-      --xtrabackup_backup_flags string                                   flags to pass to backup command. These should be space separated and will be added to the end of the command
-      --xtrabackup_prepare_flags string                                  flags to pass to prepare command. These should be space separated and will be added to the end of the command
-      --xtrabackup_root_path string                                      directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
-      --xtrabackup_stream_mode string                                    which mode to use if streaming, valid values are tar and xbstream (default "tar")
-      --xtrabackup_stripe_block_size uint                                Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
-      --xtrabackup_stripes uint                                          If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
-      --xtrabackup_user string                                           User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.
diff --git a/go/flags/endtoend/vtbackup.txt b/go/flags/endtoend/vtbackup.txt
index 36725c94de..7f8147265a 100644
--- a/go/flags/endtoend/vtbackup.txt
+++ b/go/flags/endtoend/vtbackup.txt
@@ -165,11 +165,11 @@ Usage of vtbackup:
       --v Level                                         log level for V logs
   -v, --version                                         print binary version
       --vmodule moduleSpec                              comma-separated list of pattern=N settings for file-filtered logging
-      --xbstream_restore_flags string                   flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
-      --xtrabackup_backup_flags string                  flags to pass to backup command. These should be space separated and will be added to the end of the command
-      --xtrabackup_prepare_flags string                 flags to pass to prepare command. These should be space separated and will be added to the end of the command
-      --xtrabackup_root_path string                     directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
-      --xtrabackup_stream_mode string                   which mode to use if streaming, valid values are tar and xbstream (default "tar")
+      --xbstream_restore_flags string                   Flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
+      --xtrabackup_backup_flags string                  Flags to pass to backup command. These should be space separated and will be added to the end of the command
+      --xtrabackup_prepare_flags string                 Flags to pass to prepare command. These should be space separated and will be added to the end of the command
+      --xtrabackup_root_path string                     Directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
+      --xtrabackup_stream_mode string                   Which mode to use if streaming, valid values are tar and xbstream. Please note that tar is not supported in XtraBackup 8.0 (default "tar")
       --xtrabackup_stripe_block_size uint               Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
       --xtrabackup_stripes uint                         If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
       --xtrabackup_user string                          User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.
diff --git a/go/flags/endtoend/vtctld.txt b/go/flags/endtoend/vtctld.txt
index fb0a3c70dc..887a4da95b 100644
--- a/go/flags/endtoend/vtctld.txt
+++ b/go/flags/endtoend/vtctld.txt
@@ -1,9 +1,6 @@
 Usage of vtctld:
       --action_timeout duration                                          time to wait for an action before resorting to force (default 2m0s)
-      --allowed_tablet_types []topodatapb.TabletType                     Specifies the tablet types this vtgate is allowed to route queries to.
       --alsologtostderr                                                  log to standard error as well as files
-      --app_idle_timeout duration                                        Idle timeout for app connections (default 1m0s)
-      --app_pool_size int                                                Size of the connection pool for app connections (default 40)
       --azblob_backup_account_key_file string                            Path to a file containing the Azure Storage account key; if this flag is unset, the environment variable VT_AZBLOB_ACCOUNT_KEY will be used as the key itself (NOT a file path).
       --azblob_backup_account_name string                                Azure Storage Account name for backups; if this flag is unset, the environment variable VT_AZBLOB_ACCOUNT_NAME will be used.
       --azblob_backup_container_name string                              Azure Blob Container Name.
@@ -24,13 +21,9 @@ Usage of vtctld:
       --consul_auth_static_file string                                   JSON File to read the topos/tokens from.
       --datadog-agent-host string                                        host to send spans to. if empty, no tracing will be done
       --datadog-agent-port string                                        port to send spans to. if empty, no tracing will be done
-      --dba_idle_timeout duration                                        Idle timeout for dba connections (default 1m0s)
-      --dba_pool_size int                                                Size of the connection pool for dba connections (default 20)
       --disable_active_reparents                                         if set, do not allow active reparents. Use this to protect a cluster using external reparents.
       --durability_policy string                                         type of durability to enforce. Default is none. Other values are dictated by registered plugins (default "none")
       --emit_stats                                                       If set, emit stats to push-based monitoring and stats backends
-      --enable_realtime_stats                                            Required for the Realtime Stats view. If set, vtctld will maintain a streaming RPC to each tablet (in all cells) to gather the realtime health stats.
-      --enable_vtctld_ui                                                 If true, the vtctld web interface will be enabled. Default is true. (default true)
       --external-compressor string                                       command with arguments to use when compressing a backup.
       --external-compressor-extension string                             extension to use when using an external compressor.
       --external-decompressor string                                     command with arguments to use when decompressing a backup.
@@ -66,27 +59,21 @@ Usage of vtctld:
       --jaeger-agent-host string                                         host and port to send spans to. if empty, no tracing will be done
       --keep_logs duration                                               keep logs for this long (using ctime) (zero to keep forever)
       --keep_logs_by_mtime duration                                      keep logs for this long (using mtime) (zero to keep forever)
-      --keyspaces_to_watch strings                                       Specifies which keyspaces this vtgate should have access to while routing queries or accessing the vschema.
       --lameduck-period duration                                         keep running at least this long after SIGTERM before stopping (default 50ms)
       --log_backtrace_at traceLocation                                   when logging hits line file:N, emit a stack trace (default :0)
       --log_dir string                                                   If non-empty, write log files in this directory
       --log_err_stacks                                                   log stack traces for errors
       --log_rotate_max_size uint                                         size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
       --logtostderr                                                      log to standard error instead of files
-      --mysql_server_version string                                      MySQL server version to advertise.
-      --mysqlctl_mycnf_template string                                   template file to use for generating the my.cnf file during server init
-      --mysqlctl_socket string                                           socket file to use for remote mysqlctl actions (empty for local actions)
       --onclose_timeout duration                                         wait no more than this for OnClose handlers before stopping (default 1ns)
       --onterm_timeout duration                                          wait no more than this for OnTermSync handlers before stopping (default 10s)
       --opentsdb_uri string                                              URI of opentsdb /api/put method
       --pid_file string                                                  If set, the process will write its pid to the named file, and delete it on graceful shutdown.
-      --pool_hostname_resolve_interval duration                          if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
       --port int                                                         port for the server
       --pprof strings                                                    enable profiling
       --proxy_tablets                                                    Setting this true will make vtctld proxy the tablet status instead of redirecting to them
       --purge_logs_interval duration                                     how often try to remove old logs (default 1h0m0s)
       --remote_operation_timeout duration                                time to wait for a remote operation (default 30s)
-      --replication_connect_retry duration                               how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
       --s3_backup_aws_endpoint string                                    endpoint of the S3 backend (region must be provided).
       --s3_backup_aws_region string                                      AWS region to use. (default "us-east-1")
       --s3_backup_aws_retries int                                        AWS request retries. (default -1)
@@ -112,7 +99,6 @@ Usage of vtctld:
       --stats_emit_period duration                                       Interval between emitting stats to all registered backends (default 1m0s)
       --stderrthreshold severity                                         logs at or above this threshold go to stderr (default 1)
       --tablet_dir string                                                The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid.
-      --tablet_filters strings                                           Specifies a comma-separated list of 'keyspace|shard_name or keyrange' values to filter the tablets to watch.
       --tablet_grpc_ca string                                            the server ca to use to validate servers when connecting
       --tablet_grpc_cert string                                          the cert to use to connect
       --tablet_grpc_crl string                                           the server crl to use to validate server certificates when connecting
@@ -164,21 +150,3 @@ Usage of vtctld:
       --vtctl_healthcheck_topology_refresh duration                      refresh interval for re-reading the topology (default 30s)
       --vtctld_sanitize_log_messages                                     When true, vtctld sanitizes logging.
       --vtctld_show_topology_crud                                        Controls the display of the CRUD topology actions in the vtctld UI. (default true)
-      --vtgate_grpc_ca string                                            the server ca to use to validate servers when connecting
-      --vtgate_grpc_cert string                                          the cert to use to connect
-      --vtgate_grpc_crl string                                           the server crl to use to validate server certificates when connecting
-      --vtgate_grpc_key string                                           the key to use to connect
-      --vtgate_grpc_server_name string                                   the server name to use to validate server certificate
-      --web_dir string                                                   NOT USED, here for backward compatibility
-      --web_dir2 string                                                  NOT USED, here for backward compatibility
-      --workflow_manager_disable strings                                 comma separated list of workflow types to disable
-      --workflow_manager_init                                            Initialize the workflow manager in this vtctld instance.
-      --workflow_manager_use_election                                    if specified, will use a topology server-based master election to ensure only one workflow manager is active at a time.
-      --xbstream_restore_flags string                                    flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
-      --xtrabackup_backup_flags string                                   flags to pass to backup command. These should be space separated and will be added to the end of the command
-      --xtrabackup_prepare_flags string                                  flags to pass to prepare command. These should be space separated and will be added to the end of the command
-      --xtrabackup_root_path string                                      directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
-      --xtrabackup_stream_mode string                                    which mode to use if streaming, valid values are tar and xbstream (default "tar")
-      --xtrabackup_stripe_block_size uint                                Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
-      --xtrabackup_stripes uint                                          If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
-      --xtrabackup_user string                                           User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.
diff --git a/go/flags/endtoend/vtexplain.txt b/go/flags/endtoend/vtexplain.txt
index 26becfe7d4..2666e0b5f6 100644
--- a/go/flags/endtoend/vtexplain.txt
+++ b/go/flags/endtoend/vtexplain.txt
@@ -1,17 +1,8 @@
 Usage of vtexplain:
       --alsologtostderr                              log to standard error as well as files
-      --app_idle_timeout duration                    Idle timeout for app connections (default 1m0s)
-      --app_pool_size int                            Size of the connection pool for app connections (default 40)
-      --backup_engine_implementation string          Specifies which implementation to use for creating new backups (builtin or xtrabackup). Restores will always be done with whichever engine created a given backup. (default "builtin")
-      --backup_storage_block_size int                if backup_storage_compress is true, backup_storage_block_size sets the byte size for each block while compressing (default is 250000). (default 250000)
-      --backup_storage_compress                      if set, the backup files will be compressed (default is true). Set to false for instance if a backup_storage_hook is specified and it compresses the data. (default true)
-      --backup_storage_number_blocks int             if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, at once, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2)
       --batch-interval duration                      Interval between logical time slots. (default 10ms)
-      --dba_idle_timeout duration                    Idle timeout for dba connections (default 1m0s)
-      --dba_pool_size int                            Size of the connection pool for dba connections (default 20)
       --dbname string                                Optional database target to override normal routing
       --default_tablet_type topodatapb.TabletType    The default tablet type to set for queries, when one is not explicitly selected. (default PRIMARY)
-      --disable_active_reparents                     if set, do not allow active reparents. Use this to protect a cluster using external reparents.
       --execution-mode string                        The execution mode to simulate -- must be set to multi, legacy-autocommit, or twopc (default "multi")
   -h, --help                                         display usage and exit
       --keep_logs duration                           keep logs for this long (using ctime) (zero to keep forever)
@@ -45,18 +36,14 @@ Usage of vtexplain:
       --mysql_server_write_timeout duration          connection write timeout (default 0s)
       --mysql_slow_connect_warn_threshold duration   Warn if it takes more than the given threshold for a mysql connection to establish (default 0s)
       --mysql_tcp_version string                     Select tcp, tcp4, or tcp6 to control the socket type. (default "tcp")
-      --mysqlctl_mycnf_template string               template file to use for generating the my.cnf file during server init
-      --mysqlctl_socket string                       socket file to use for remote mysqlctl actions (empty for local actions)
       --normalize                                    Whether to enable vtgate normalization
       --output-mode string                           Output in human-friendly text or json (default "text")
       --planner-version string                       Sets the query planner version to use when generating the explain output. Valid values are V3 and Gen4
-      --pool_hostname_resolve_interval duration      if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)
       --pprof strings                                enable profiling
       --proxy_protocol                               Enable HAProxy PROXY protocol on MySQL listener socket
       --purge_logs_interval duration                 how often try to remove old logs (default 1h0m0s)
       --querylog-buffer-size int                     Maximum number of buffered query logs before throttling log output (default 10)
       --replication-mode string                      The replication mode to simulate -- must be set to either ROW or STATEMENT (default "ROW")
-      --replication_connect_retry duration           how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
       --schema string                                The SQL table schema
       --schema-file string                           Identifies the file that contains the SQL table schema
       --security_policy string                       the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
@@ -66,17 +53,8 @@ Usage of vtexplain:
       --sql-max-length-errors int                    truncate queries in error logs to the given length (default unlimited)
       --sql-max-length-ui int                        truncate queries in debug UIs to the given length (default 512) (default 512)
       --stderrthreshold severity                     logs at or above this threshold go to stderr (default 1)
-      --tablet_dir string                            The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid.
       --v Level                                      log level for V logs
   -v, --version                                      print binary version
       --vmodule moduleSpec                           comma-separated list of pattern=N settings for file-filtered logging
       --vschema string                               Identifies the VTGate routing schema
       --vschema-file string                          Identifies the VTGate routing schema file
-      --xbstream_restore_flags string                flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
-      --xtrabackup_backup_flags string               flags to pass to backup command. These should be space separated and will be added to the end of the command
-      --xtrabackup_prepare_flags string              flags to pass to prepare command. These should be space separated and will be added to the end of the command
-      --xtrabackup_root_path string                  directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
-      --xtrabackup_stream_mode string                which mode to use if streaming, valid values are tar and xbstream (default "tar")
-      --xtrabackup_stripe_block_size uint            Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
-      --xtrabackup_stripes uint                      If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
-      --xtrabackup_user string                       User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.
diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt
index 9744a392d8..e9e8591896 100644
--- a/go/flags/endtoend/vtgate.txt
+++ b/go/flags/endtoend/vtgate.txt
@@ -1,5 +1,5 @@
 Usage of vtgate:
-      --allowed_tablet_types []topodatapb.TabletType                     Specifies the tablet types this vtgate is allowed to route queries to.
+      --allowed_tablet_types strings                                     Specifies the tablet types this vtgate is allowed to route queries to. Should be provided as a comma-separated set of tablet types.
       --alsologtostderr                                                  log to standard error as well as files
       --buffer_drain_concurrency int                                     Maximum number of requests retried simultaneously. More concurrency will increase the load on the PRIMARY vttablet when draining the buffer. (default 1)
       --buffer_implementation string                                     Allowed values: healthcheck (legacy implementation), keyspace_events (default) (default "keyspace_events")
@@ -161,7 +161,7 @@ Usage of vtgate:
       --tablet_protocol string                                           Protocol to use to make queryservice RPCs to vttablets. (default "grpc")
       --tablet_refresh_interval duration                                 Tablet refresh interval. (default 1m0s)
       --tablet_refresh_known_tablets                                     Whether to reload the tablet's address/port map from topo in case they change. (default true)
-      --tablet_types_to_wait string                                      wait till connected for specified tablet types during Gateway initialization
+      --tablet_types_to_wait strings                                     Wait till connected for specified tablet types during Gateway initialization. Should be provided as a comma-separated set of tablet types.
       --tablet_url_template string                                       Format string describing debug tablet url formatting. See getTabletDebugURL() for how to customize this. (default "http://{{.GetTabletHostPort}}")
       --topo_consul_lock_delay duration                                  LockDelay for consul session. (default 15s)
       --topo_consul_lock_session_checks string                           List of checks for consul session. (default "serfHealth")
diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt
index 6b190636ae..25807a7a68 100644
--- a/go/flags/endtoend/vttablet.txt
+++ b/go/flags/endtoend/vttablet.txt
@@ -367,11 +367,11 @@ Usage of vttablet:
       --vttablet_skip_buildinfo_tags string                              comma-separated list of buildinfo tags to skip from merging with --init_tags. each tag is either an exact match or a regular expression of the form '/regexp/'. (default "/.*/")
       --wait_for_backup_interval duration                                (init restore parameter) if this is greater than 0, instead of starting up empty when no backups are found, keep checking at this interval for a backup to appear
       --watch_replication_stream                                         When enabled, vttablet will stream the MySQL replication stream from the local server, and use it to update schema when it sees a DDL.
-      --xbstream_restore_flags string                                    flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
-      --xtrabackup_backup_flags string                                   flags to pass to backup command. These should be space separated and will be added to the end of the command
-      --xtrabackup_prepare_flags string                                  flags to pass to prepare command. These should be space separated and will be added to the end of the command
-      --xtrabackup_root_path string                                      directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
-      --xtrabackup_stream_mode string                                    which mode to use if streaming, valid values are tar and xbstream (default "tar")
+      --xbstream_restore_flags string                                    Flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
+      --xtrabackup_backup_flags string                                   Flags to pass to backup command. These should be space separated and will be added to the end of the command
+      --xtrabackup_prepare_flags string                                  Flags to pass to prepare command. These should be space separated and will be added to the end of the command
+      --xtrabackup_root_path string                                      Directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
+      --xtrabackup_stream_mode string                                    Which mode to use if streaming, valid values are tar and xbstream. Please note that tar is not supported in XtraBackup 8.0 (default "tar")
       --xtrabackup_stripe_block_size uint                                Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
       --xtrabackup_stripes uint                                          If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
       --xtrabackup_user string                                           User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.
diff --git a/go/vt/discovery/healthcheck.go b/go/vt/discovery/healthcheck.go
index 9a03823e9e..be08528889 100644
--- a/go/vt/discovery/healthcheck.go
+++ b/go/vt/discovery/healthcheck.go
@@ -147,19 +147,25 @@ func ParseTabletURLTemplateFromFlag() {
 }
 
 func init() {
-	servenv.OnParseFor("vtgate", registerDiscoveryFlags)
-	servenv.OnParseFor("vtcombo", registerDiscoveryFlags)
-	servenv.OnParseFor("vtctld", registerDiscoveryFlags)
+	for _, cmd := range []string{"vtgate", "vtcombo"} {
+		servenv.OnParseFor(cmd, registerDiscoveryFlags)
+		servenv.OnParseFor(cmd, registerWebUIFlags)
+	}
+
+	servenv.OnParseFor("vtctld", registerWebUIFlags)
 }
 
 func registerDiscoveryFlags(fs *pflag.FlagSet) {
+	fs.StringSliceVar(&tabletFilters, "tablet_filters", []string{}, "Specifies a comma-separated list of 'keyspace|shard_name or keyrange' values to filter the tablets to watch.")
+	fs.Var((*topoproto.TabletTypeListFlag)(&AllowedTabletTypes), "allowed_tablet_types", "Specifies the tablet types this vtgate is allowed to route queries to. Should be provided as a comma-separated set of tablet types.")
+	fs.StringSliceVar(&KeyspacesToWatch, "keyspaces_to_watch", []string{}, "Specifies which keyspaces this vtgate should have access to while routing queries or accessing the vschema.")
+}
+
+func registerWebUIFlags(fs *pflag.FlagSet) {
 	fs.StringVar(&TabletURLTemplateString, "tablet_url_template", "http://{{.GetTabletHostPort}}", "Format string describing debug tablet url formatting. See getTabletDebugURL() for how to customize this.")
 	fs.DurationVar(&refreshInterval, "tablet_refresh_interval", 1*time.Minute, "Tablet refresh interval.")
 	fs.BoolVar(&refreshKnownTablets, "tablet_refresh_known_tablets", true, "Whether to reload the tablet's address/port map from topo in case they change.")
 	fs.IntVar(&topoReadConcurrency, "topo_read_concurrency", 32, "Concurrency of topo reads.")
-	fs.StringSliceVar(&tabletFilters, "tablet_filters", []string{}, "Specifies a comma-separated list of 'keyspace|shard_name or keyrange' values to filter the tablets to watch.")
-	fs.Var((*topoproto.TabletTypeListFlag)(&AllowedTabletTypes), "allowed_tablet_types", "Specifies the tablet types this vtgate is allowed to route queries to.")
-	fs.StringSliceVar(&KeyspacesToWatch, "keyspaces_to_watch", []string{}, "Specifies which keyspaces this vtgate should have access to while routing queries or accessing the vschema.")
 	ParseTabletURLTemplateFromFlag()
 }
 
diff --git a/go/vt/mysqlctl/backup.go b/go/vt/mysqlctl/backup.go
index a11ddb75ce..7d62681c5d 100644
--- a/go/vt/mysqlctl/backup.go
+++ b/go/vt/mysqlctl/backup.go
@@ -97,7 +97,7 @@ var (
 )
 
 func init() {
-	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver", "vtbackup", "vtctld", "vtctldclient", "vtexplain"} {
+	for _, cmd := range []string{"vtcombo", "vttablet", "vttestserver", "vtbackup", "vtctld"} {
 		servenv.OnParseFor(cmd, registerBackupFlags)
 	}
 }
diff --git a/go/vt/mysqlctl/backupengine.go b/go/vt/mysqlctl/backupengine.go
index dceb34e3d4..acc20e8126 100644
--- a/go/vt/mysqlctl/backupengine.go
+++ b/go/vt/mysqlctl/backupengine.go
@@ -112,7 +112,7 @@ type BackupRestoreEngine interface {
 var BackupRestoreEngineMap = make(map[string]BackupRestoreEngine)
 
 func init() {
-	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient", "vtexplain", "vtbackup"} {
+	for _, cmd := range []string{"vtcombo", "vttablet", "vttestserver", "vtctld", "vtbackup"} {
 		servenv.OnParseFor(cmd, registerBackupEngineFlags)
 	}
 }
diff --git a/go/vt/mysqlctl/builtinbackupengine.go b/go/vt/mysqlctl/builtinbackupengine.go
index 22ff4ffff8..f4c0a0b516 100644
--- a/go/vt/mysqlctl/builtinbackupengine.go
+++ b/go/vt/mysqlctl/builtinbackupengine.go
@@ -113,7 +113,7 @@ type FileEntry struct {
 }
 
 func init() {
-	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient"} {
+	for _, cmd := range []string{"vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient"} {
 		servenv.OnParseFor(cmd, registerBuiltinBackupEngineFlags)
 	}
 }
diff --git a/go/vt/mysqlctl/compression.go b/go/vt/mysqlctl/compression.go
index 1d2a4aba3d..4687bec026 100644
--- a/go/vt/mysqlctl/compression.go
+++ b/go/vt/mysqlctl/compression.go
@@ -65,7 +65,7 @@ var (
 )
 
 func init() {
-	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient"} {
+	for _, cmd := range []string{"vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient"} {
 		servenv.OnParseFor(cmd, registerBackupCompressionFlags)
 	}
 }
diff --git a/go/vt/mysqlctl/mycnf_gen.go b/go/vt/mysqlctl/mycnf_gen.go
index 3024b3bb5e..2ac47fe617 100644
--- a/go/vt/mysqlctl/mycnf_gen.go
+++ b/go/vt/mysqlctl/mycnf_gen.go
@@ -59,7 +59,7 @@ var (
 )
 
 func init() {
-	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient", "vtexplain"} {
+	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient"} {
 		servenv.OnParseFor(cmd, registerMyCnfFlags)
 	}
 }
diff --git a/go/vt/mysqlctl/mysqld.go b/go/vt/mysqlctl/mysqld.go
index 2738caed2b..45ec3b7bd7 100644
--- a/go/vt/mysqlctl/mysqld.go
+++ b/go/vt/mysqlctl/mysqld.go
@@ -100,23 +100,35 @@ type Mysqld struct {
 }
 
 func init() {
-	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient", "vtexplain"} {
+	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver"} {
 		servenv.OnParseFor(cmd, registerMySQLDFlags)
 	}
+	for _, cmd := range []string{"vtcombo", "vttablet", "vttestserver", "vtctld", "vtctldclient"} {
+		servenv.OnParseFor(cmd, registerReparentFlags)
+	}
+	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vttestserver"} {
+		servenv.OnParseFor(cmd, registerPoolFlags)
+	}
 }
 
 func registerMySQLDFlags(fs *pflag.FlagSet) {
-	fs.BoolVar(&DisableActiveReparents, "disable_active_reparents", DisableActiveReparents, "if set, do not allow active reparents. Use this to protect a cluster using external reparents.")
-	fs.IntVar(&dbaPoolSize, "dba_pool_size", dbaPoolSize, "Size of the connection pool for dba connections")
-	fs.DurationVar(&DbaIdleTimeout, "dba_idle_timeout", DbaIdleTimeout, "Idle timeout for dba connections")
-	fs.IntVar(&appPoolSize, "app_pool_size", appPoolSize, "Size of the connection pool for app connections")
-	fs.DurationVar(&appIdleTimeout, "app_idle_timeout", appIdleTimeout, "Idle timeout for app connections")
 	fs.DurationVar(&PoolDynamicHostnameResolution, "pool_hostname_resolve_interval", PoolDynamicHostnameResolution, "if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)")
 	fs.StringVar(&mycnfTemplateFile, "mysqlctl_mycnf_template", mycnfTemplateFile, "template file to use for generating the my.cnf file during server init")
 	fs.StringVar(&socketFile, "mysqlctl_socket", socketFile, "socket file to use for remote mysqlctl actions (empty for local actions)")
 	fs.DurationVar(&replicationConnectRetry, "replication_connect_retry", replicationConnectRetry, "how long to wait in between replica reconnect attempts. Only precise to the second.")
 }
 
+func registerReparentFlags(fs *pflag.FlagSet) {
+	fs.BoolVar(&DisableActiveReparents, "disable_active_reparents", DisableActiveReparents, "if set, do not allow active reparents. Use this to protect a cluster using external reparents.")
+}
+
+func registerPoolFlags(fs *pflag.FlagSet) {
+	fs.IntVar(&dbaPoolSize, "dba_pool_size", dbaPoolSize, "Size of the connection pool for dba connections")
+	fs.DurationVar(&DbaIdleTimeout, "dba_idle_timeout", DbaIdleTimeout, "Idle timeout for dba connections")
+	fs.DurationVar(&appIdleTimeout, "app_idle_timeout", appIdleTimeout, "Idle timeout for app connections")
+	fs.IntVar(&appPoolSize, "app_pool_size", appPoolSize, "Size of the connection pool for app connections")
+}
+
 // NewMysqld creates a Mysqld object based on the provided configuration
 // and connection parameters.
 func NewMysqld(dbcfgs *dbconfigs.DBConfigs) *Mysqld {
diff --git a/go/vt/mysqlctl/xtrabackupengine.go b/go/vt/mysqlctl/xtrabackupengine.go
index 112bdf4179..38f29cee69 100644
--- a/go/vt/mysqlctl/xtrabackupengine.go
+++ b/go/vt/mysqlctl/xtrabackupengine.go
@@ -105,17 +105,17 @@ type xtraBackupManifest struct {
 }
 
 func init() {
-	for _, cmd := range []string{"mysqlctl", "mysqlctld", "vtcombo", "vttablet", "vtbackup", "vttestserver", "vtctld", "vtctldclient", "vtexplain"} {
+	for _, cmd := range []string{"vtcombo", "vttablet", "vtbackup", "vttestserver", "vtctldclient"} {
 		servenv.OnParseFor(cmd, registerXtraBackupEngineFlags)
 	}
 }
 
 func registerXtraBackupEngineFlags(fs *pflag.FlagSet) {
-	fs.StringVar(&xtrabackupEnginePath, "xtrabackup_root_path", xtrabackupEnginePath, "directory location of the xtrabackup and xbstream executables, e.g., /usr/bin")
-	fs.StringVar(&xtrabackupBackupFlags, "xtrabackup_backup_flags", xtrabackupBackupFlags, "flags to pass to backup command. These should be space separated and will be added to the end of the command")
-	fs.StringVar(&xtrabackupPrepareFlags, "xtrabackup_prepare_flags", xtrabackupPrepareFlags, "flags to pass to prepare command. These should be space separated and will be added to the end of the command")
-	fs.StringVar(&xbstreamRestoreFlags, "xbstream_restore_flags", xbstreamRestoreFlags, "flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt")
-	fs.StringVar(&xtrabackupStreamMode, "xtrabackup_stream_mode", xtrabackupStreamMode, "which mode to use if streaming, valid values are tar and xbstream")
+	fs.StringVar(&xtrabackupEnginePath, "xtrabackup_root_path", xtrabackupEnginePath, "Directory location of the xtrabackup and xbstream executables, e.g., /usr/bin")
+	fs.StringVar(&xtrabackupBackupFlags, "xtrabackup_backup_flags", xtrabackupBackupFlags, "Flags to pass to backup command. These should be space separated and will be added to the end of the command")
+	fs.StringVar(&xtrabackupPrepareFlags, "xtrabackup_prepare_flags", xtrabackupPrepareFlags, "Flags to pass to prepare command. These should be space separated and will be added to the end of the command")
+	fs.StringVar(&xbstreamRestoreFlags, "xbstream_restore_flags", xbstreamRestoreFlags, "Flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt")
+	fs.StringVar(&xtrabackupStreamMode, "xtrabackup_stream_mode", xtrabackupStreamMode, "Which mode to use if streaming, valid values are tar and xbstream. Please note that tar is not supported in XtraBackup 8.0")
 	fs.StringVar(&xtrabackupUser, "xtrabackup_user", xtrabackupUser, "User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.")
 	fs.UintVar(&xtrabackupStripes, "xtrabackup_stripes", xtrabackupStripes, "If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression")
 	fs.UintVar(&xtrabackupStripeBlockSize, "xtrabackup_stripe_block_size", xtrabackupStripeBlockSize, "Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe")
diff --git a/go/vt/servenv/mysql.go b/go/vt/servenv/mysql.go
index e74d4d07ac..e5d37bd539 100644
--- a/go/vt/servenv/mysql.go
+++ b/go/vt/servenv/mysql.go
@@ -51,7 +51,6 @@ func init() {
 		"vtbackup",
 		"vtcombo",
 		"vtctl",
-		"vtctld",
 		"vtctldclient",
 		"vtexplain",
 		"vtgate",
diff --git a/go/vt/topo/topoproto/flag.go b/go/vt/topo/topoproto/flag.go
index d92378017a..becc789b59 100644
--- a/go/vt/topo/topoproto/flag.go
+++ b/go/vt/topo/topoproto/flag.go
@@ -39,7 +39,7 @@ func (ttlv *TabletTypeListFlag) Set(v string) (err error) {
 
 // Type is part of the pflag.Value interface.
 func (ttlv *TabletTypeListFlag) Type() string {
-	return "[]topodatapb.TabletType"
+	return "strings"
 }
 
 // TabletTypeFlag implements the pflag.Value interface, for parsing a command-line value into a TabletType.
diff --git a/go/vt/vtctld/vtctld.go b/go/vt/vtctld/vtctld.go
index 40973864dd..a599b5a0ed 100644
--- a/go/vt/vtctld/vtctld.go
+++ b/go/vt/vtctld/vtctld.go
@@ -60,11 +60,15 @@ func init() {
 
 func registerVtctldFlags(fs *pflag.FlagSet) {
 	fs.BoolVar(&enableRealtimeStats, "enable_realtime_stats", enableRealtimeStats, "Required for the Realtime Stats view. If set, vtctld will maintain a streaming RPC to each tablet (in all cells) to gather the realtime health stats.")
+	fs.MarkDeprecated("enable_realtime_stats", "It is used by old vtctl UI that is already deprecated.")
 	fs.BoolVar(&enableUI, "enable_vtctld_ui", enableUI, "If true, the vtctld web interface will be enabled. Default is true.")
+	fs.MarkDeprecated("enable_vtctld_ui", "It is used by old vtctl UI that is already deprecated.")
 	fs.StringVar(&durabilityPolicy, "durability_policy", durabilityPolicy, "type of durability to enforce. Default is none. Other values are dictated by registered plugins")
 	fs.BoolVar(&sanitizeLogMessages, "vtctld_sanitize_log_messages", sanitizeLogMessages, "When true, vtctld sanitizes logging.")
 	fs.StringVar(&webDir, "web_dir", webDir, "NOT USED, here for backward compatibility")
+	fs.MarkDeprecated("web_dir", "it will be removed in a future releases.")
 	fs.StringVar(&webDir2, "web_dir2", webDir2, "NOT USED, here for backward compatibility")
+	fs.MarkDeprecated("web_dir2", "it will be removed in a future releases.")
 }
 
 // InitVtctld initializes all the vtctld functionality.
diff --git a/go/vt/vtctld/workflow.go b/go/vt/vtctld/workflow.go
index bafc6ad867..ef9b4f3b1c 100644
--- a/go/vt/vtctld/workflow.go
+++ b/go/vt/vtctld/workflow.go
@@ -41,8 +41,11 @@ var (
 
 func registerVtctldWorkflowFlags(fs *pflag.FlagSet) {
 	fs.BoolVar(&workflowManagerInit, "workflow_manager_init", workflowManagerInit, "Initialize the workflow manager in this vtctld instance.")
+	fs.MarkDeprecated("workflow_manager_init", "it will be removed in a future releases.")
 	fs.BoolVar(&workflowManagerUseElection, "workflow_manager_use_election", workflowManagerUseElection, "if specified, will use a topology server-based master election to ensure only one workflow manager is active at a time.")
+	fs.MarkDeprecated("workflow_manager_use_election", "it will be removed in a future releases.")
 	fs.StringSliceVar(&workflowManagerDisable, "workflow_manager_disable", workflowManagerDisable, "comma separated list of workflow types to disable")
+	fs.MarkDeprecated("workflow_manager_disable", "it will be removed in a future releases.")
 }
 
 func init() {
diff --git a/go/vt/vtgate/engine/concatenate.go b/go/vt/vtgate/engine/concatenate.go
index e11adce385..7858ccfc93 100644
--- a/go/vt/vtgate/engine/concatenate.go
+++ b/go/vt/vtgate/engine/concatenate.go
@@ -143,12 +143,23 @@ func (c *Concatenate) getFields(res []*sqltypes.Result) ([]*querypb.Field, error
 }
 
 func (c *Concatenate) execSources(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) ([]*sqltypes.Result, error) {
-	var cancel context.CancelFunc
-	ctx, cancel = context.WithCancel(ctx)
-	defer cancel()
+	if vcursor.Session().InTransaction() {
+		// as we are in a transaction, we need to execute all queries inside a single transaction
+		// therefore it needs a sequential execution.
+		return c.sequentialExec(ctx, vcursor, bindVars, wantfields)
+	}
+	// not in transaction, so execute in parallel.
+	return c.parallelExec(ctx, vcursor, bindVars, wantfields)
+}
+
+func (c *Concatenate) parallelExec(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) ([]*sqltypes.Result, error) {
 	results := make([]*sqltypes.Result, len(c.Sources))
-	var wg sync.WaitGroup
 	var outerErr error
+
+	ctx, cancel := context.WithCancel(ctx)
+	defer cancel()
+
+	var wg sync.WaitGroup
 	for i, source := range c.Sources {
 		currIndex, currSource := i, source
 		vars := copyBindVars(bindVars)
@@ -164,14 +175,35 @@ func (c *Concatenate) execSources(ctx context.Context, vcursor VCursor, bindVars
 		}()
 	}
 	wg.Wait()
-	if outerErr != nil {
-		return nil, outerErr
+	return results, outerErr
+}
+
+func (c *Concatenate) sequentialExec(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) ([]*sqltypes.Result, error) {
+	results := make([]*sqltypes.Result, len(c.Sources))
+	for i, source := range c.Sources {
+		currIndex, currSource := i, source
+		vars := copyBindVars(bindVars)
+		result, err := vcursor.ExecutePrimitive(ctx, currSource, vars, wantfields)
+		if err != nil {
+			return nil, err
+		}
+		results[currIndex] = result
 	}
 	return results, nil
 }
 
 // TryStreamExecute performs a streaming exec.
 func (c *Concatenate) TryStreamExecute(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error {
+	if vcursor.Session().InTransaction() {
+		// as we are in a transaction, we need to execute all queries inside a single transaction
+		// therefore it needs a sequential execution.
+		return c.sequentialStreamExec(ctx, vcursor, bindVars, wantfields, callback)
+	}
+	// not in transaction, so execute in parallel.
+	return c.parallelStreamExec(ctx, vcursor, bindVars, wantfields, callback)
+}
+
+func (c *Concatenate) parallelStreamExec(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error {
 	var seenFields []*querypb.Field
 	var outerErr error
 
@@ -237,6 +269,44 @@ func (c *Concatenate) TryStreamExecute(ctx context.Context, vcursor VCursor, bin
 	return outerErr
 }
 
+func (c *Concatenate) sequentialStreamExec(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool, callback func(*sqltypes.Result) error) error {
+	// all the below fields ensure that the fields are sent only once.
+	var seenFields []*querypb.Field
+	var fieldsMu sync.Mutex
+	var fieldsSent bool
+
+	for idx, source := range c.Sources {
+		err := vcursor.StreamExecutePrimitive(ctx, source, bindVars, wantfields, func(resultChunk *sqltypes.Result) error {
+			// if we have fields to compare, make sure all the fields are all the same
+			if idx == 0 {
+				fieldsMu.Lock()
+				defer fieldsMu.Unlock()
+				if !fieldsSent {
+					fieldsSent = true
+					seenFields = resultChunk.Fields
+					return callback(resultChunk)
+				}
+			}
+			if resultChunk.Fields != nil {
+				err := c.compareFields(seenFields, resultChunk.Fields)
+				if err != nil {
+					return err
+				}
+			}
+			// check if context has expired.
+			if ctx.Err() != nil {
+				return ctx.Err()
+			}
+			return callback(resultChunk)
+
+		})
+		if err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
 // GetFields fetches the field info.
 func (c *Concatenate) GetFields(ctx context.Context, vcursor VCursor, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) {
 	// TODO: type coercions
diff --git a/go/vt/vtgate/engine/primitive.go b/go/vt/vtgate/engine/primitive.go
index 796c1dcb55..51725adc5d 100644
--- a/go/vt/vtgate/engine/primitive.go
+++ b/go/vt/vtgate/engine/primitive.go
@@ -180,6 +180,10 @@ type (
 		// SetCommitOrder sets the commit order for the shard session in respect of the type of vindex lookup.
 		// This is used to select the right shard session to perform the vindex lookup query.
 		SetCommitOrder(co vtgatepb.CommitOrder)
+
+		// InTransaction returns true if the session has already opened transaction or
+		// will start a transaction on the query execution.
+		InTransaction() bool
 	}
 
 	// Match is used to check if a Primitive matches
diff --git a/go/vt/vtgate/grpcvtgateconn/conn.go b/go/vt/vtgate/grpcvtgateconn/conn.go
index 1f29d1c8c4..0fb76dfefe 100644
--- a/go/vt/vtgate/grpcvtgateconn/conn.go
+++ b/go/vt/vtgate/grpcvtgateconn/conn.go
@@ -53,7 +53,6 @@ func init() {
 		"vtclient",
 		"vtcombo",
 		"vtctl",
-		"vtctld",
 		"vttestserver",
 	} {
 		servenv.OnParseFor(cmd, registerFlags)
diff --git a/go/vt/vtgate/planbuilder/physical/route_planning.go b/go/vt/vtgate/planbuilder/physical/route_planning.go
index caedb1ab18..6e177ee71b 100644
--- a/go/vt/vtgate/planbuilder/physical/route_planning.go
+++ b/go/vt/vtgate/planbuilder/physical/route_planning.go
@@ -226,6 +226,19 @@ func createPhysicalOperatorFromDelete(ctx *plancontext.PlanningContext, op *abst
 		return nil, err
 	}
 
+	if !vindexTable.Keyspace.Sharded {
+		return &Route{
+			Source: &Delete{
+				QTable: op.Table,
+				VTable: vindexTable,
+				AST:    op.AST,
+			},
+			RouteOpCode:       opCode,
+			Keyspace:          vindexTable.Keyspace,
+			TargetDestination: dest,
+		}, nil
+	}
+
 	primaryVindex, vindexAndPredicates, err := getVindexInformation(op.TableID(), op.Table.Predicates, vindexTable)
 	if err != nil {
 		return nil, err
diff --git a/go/vt/vtgate/planbuilder/rewrite.go b/go/vt/vtgate/planbuilder/rewrite.go
index 284ffa9c07..4ff3edd9fd 100644
--- a/go/vt/vtgate/planbuilder/rewrite.go
+++ b/go/vt/vtgate/planbuilder/rewrite.go
@@ -174,29 +174,40 @@ func rewriteHavingClause(node *sqlparser.Select) {
 	exprs := sqlparser.SplitAndExpression(nil, node.Having.Expr)
 	node.Having = nil
 	for _, expr := range exprs {
-		var hasAggr bool
-		sqlparser.Rewrite(expr, func(cursor *sqlparser.Cursor) bool {
-			switch x := cursor.Node().(type) {
-			case *sqlparser.ColName:
-				if !x.Qualifier.IsEmpty() {
-					return false
-				}
-				originalExpr, isInMap := selectExprMap[x.Name.Lowered()]
-				if isInMap && sqlparser.ContainsAggregation(originalExpr) {
-					hasAggr = true
-				}
-				return false
-			default:
-				_, isAggregate := x.(sqlparser.AggrFunc)
-				hasAggr = hasAggr || isAggregate
-			}
-			return true
-		}, nil)
-
+		hasAggr := sqlparser.ContainsAggregation(expr)
+		if !hasAggr {
+			sqlparser.Rewrite(expr, func(cursor *sqlparser.Cursor) bool {
+				visitColName(cursor.Node(), selectExprMap, func(original sqlparser.Expr) {
+					if sqlparser.ContainsAggregation(original) {
+						hasAggr = true
+					}
+				})
+				return true
+			}, nil)
+		}
 		if hasAggr {
 			node.AddHaving(expr)
 		} else {
+			sqlparser.Rewrite(expr, func(cursor *sqlparser.Cursor) bool {
+				visitColName(cursor.Node(), selectExprMap, func(original sqlparser.Expr) {
+					cursor.Replace(original)
+				})
+				return true
+			}, nil)
 			node.AddWhere(expr)
 		}
 	}
 }
+func visitColName(cursor sqlparser.SQLNode, selectExprMap map[string]sqlparser.Expr, f func(original sqlparser.Expr)) {
+	switch x := cursor.(type) {
+	case *sqlparser.ColName:
+		if !x.Qualifier.IsEmpty() {
+			return
+		}
+		originalExpr, isInMap := selectExprMap[x.Name.Lowered()]
+		if isInMap {
+			f(originalExpr)
+		}
+		return
+	}
+}
diff --git a/go/vt/vtgate/semantics/early_rewriter.go b/go/vt/vtgate/semantics/early_rewriter.go
index 6f006efd41..7b9f5cdb49 100644
--- a/go/vt/vtgate/semantics/early_rewriter.go
+++ b/go/vt/vtgate/semantics/early_rewriter.go
@@ -128,7 +128,19 @@ func rewriteHavingAndOrderBy(cursor *sqlparser.Cursor, node sqlparser.SQLNode) {
 					continue
 				}
 				if ae.As.Equal(col.Name) {
-					inner.Replace(ae.Expr)
+					safeToRewrite := true
+					sqlparser.Rewrite(ae.Expr, func(cursor *sqlparser.Cursor) bool {
+						switch cursor.Node().(type) {
+						case *sqlparser.ColName:
+							safeToRewrite = false
+						case sqlparser.AggrFunc:
+							return false
+						}
+						return true
+					}, nil)
+					if safeToRewrite {
+						inner.Replace(ae.Expr)
+					}
 				}
 			}
 		}
diff --git a/go/vt/vtgate/vcursor_impl.go b/go/vt/vtgate/vcursor_impl.go
index 5bf0e7d730..ff2e14f854 100644
--- a/go/vt/vtgate/vcursor_impl.go
+++ b/go/vt/vtgate/vcursor_impl.go
@@ -849,6 +849,10 @@ func (vc *vcursorImpl) SetCommitOrder(co vtgatepb.CommitOrder) {
 	vc.safeSession.SetCommitOrder(co)
 }
 
+func (vc *vcursorImpl) InTransaction() bool {
+	return vc.safeSession.InTransaction()
+}
+
 // GetDBDDLPluginName implements the VCursor interface
 func (vc *vcursorImpl) GetDBDDLPluginName() string {
 	return dbDDLPlugin
diff --git a/go/vt/vtgate/vtgate.go b/go/vt/vtgate/vtgate.go
index 8d969f4ab9..de3fba2fbe 100644
--- a/go/vt/vtgate/vtgate.go
+++ b/go/vt/vtgate/vtgate.go
@@ -20,9 +20,11 @@ package vtgate
 
 import (
 	"context"
+	"errors"
 	"fmt"
 	"net/http"
 	"os"
+	"regexp"
 	"strings"
 	"time"
 
@@ -588,6 +590,12 @@ func recordAndAnnotateError(err error, statsKey []string, request map[string]any
 		ec.String(),
 	}
 
+	if terseErrors {
+		regexpBv := regexp.MustCompile(`BindVars: \{.*\}`)
+		str := regexpBv.ReplaceAllString(err.Error(), "BindVars: {REDACTED}")
+		err = errors.New(str)
+	}
+
 	// Traverse the request structure and truncate any long values
 	request = truncateErrorStrings(request)
 
diff --git a/go/vt/vttablet/sandboxconn/sandboxconn.go b/go/vt/vttablet/sandboxconn/sandboxconn.go
index 85098d9ee0..cb6e658245 100644
--- a/go/vt/vttablet/sandboxconn/sandboxconn.go
+++ b/go/vt/vttablet/sandboxconn/sandboxconn.go
@@ -657,7 +657,8 @@ func getSingleRowResult() *sqltypes.Result {
 		Rows:        SingleRowResult.Rows,
 	}
 
-	for _, field := range SingleRowResult.Fields {
+	fields := SingleRowResult.Fields
+	for _, field := range fields {
 		singleRowResult.Fields = append(singleRowResult.Fields, &querypb.Field{
 			Name: field.Name,
 			Type: field.Type,
diff --git a/go/vt/vttablet/tabletserver/tabletenv/config.go b/go/vt/vttablet/tabletserver/tabletenv/config.go
index d150791efd..df2ab5f23e 100644
--- a/go/vt/vttablet/tabletserver/tabletenv/config.go
+++ b/go/vt/vttablet/tabletserver/tabletenv/config.go
@@ -95,13 +95,13 @@ func registerTabletEnvFlags(fs *pflag.FlagSet) {
 
 	fs.IntVar(&currentConfig.OltpReadPool.Size, "queryserver-config-pool-size", defaultConfig.OltpReadPool.Size, "query server read pool size, connection pool is used by regular queries (non streaming, not in a transaction)")
 	fs.IntVar(&currentConfig.OltpReadPool.PrefillParallelism, "queryserver-config-pool-prefill-parallelism", defaultConfig.OltpReadPool.PrefillParallelism, "Query server read pool prefill parallelism, a non-zero value will prefill the pool using the specified parallism.")
-	_ = fs.MarkDeprecated("queryserver-config-pool-prefill-parallelism", "This flag is deprecated.")
+	_ = fs.MarkDeprecated("queryserver-config-pool-prefill-parallelism", "it will be removed in a future release.")
 	fs.IntVar(&currentConfig.OlapReadPool.Size, "queryserver-config-stream-pool-size", defaultConfig.OlapReadPool.Size, "query server stream connection pool size, stream pool is used by stream queries: queries that return results to client in a streaming fashion")
 	fs.IntVar(&currentConfig.OlapReadPool.PrefillParallelism, "queryserver-config-stream-pool-prefill-parallelism", defaultConfig.OlapReadPool.PrefillParallelism, "Query server stream pool prefill parallelism, a non-zero value will prefill the pool using the specified parallelism")
-	_ = fs.MarkDeprecated("queryserver-config-stream-pool-prefill-parallelism", "This flag is deprecated.")
+	_ = fs.MarkDeprecated("queryserver-config-stream-pool-prefill-parallelism", "it will be removed in a future release.")
 	fs.IntVar(&currentConfig.TxPool.Size, "queryserver-config-transaction-cap", defaultConfig.TxPool.Size, "query server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there are at most 100 transactions will be processed by a vttablet and the 101th transaction will be blocked (and fail if it cannot get connection within specified timeout)")
 	fs.IntVar(&currentConfig.TxPool.PrefillParallelism, "queryserver-config-transaction-prefill-parallelism", defaultConfig.TxPool.PrefillParallelism, "Query server transaction prefill parallelism, a non-zero value will prefill the pool using the specified parallism.")
-	_ = fs.MarkDeprecated("queryserver-config-transaction-prefill-parallelism", "This flag is deprecated.")
+	_ = fs.MarkDeprecated("queryserver-config-transaction-prefill-parallelism", "it will be removed in a future release.")
 	fs.IntVar(&currentConfig.MessagePostponeParallelism, "queryserver-config-message-postpone-cap", defaultConfig.MessagePostponeParallelism, "query server message postpone cap is the maximum number of messages that can be postponed at any given time. Set this number to substantially lower than transaction cap, so that the transaction pool isn't exhausted by the message subsystem.")
 	SecondsVar(fs, &currentConfig.Oltp.TxTimeoutSeconds, "queryserver-config-transaction-timeout", defaultConfig.Oltp.TxTimeoutSeconds, "query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value")
 	SecondsVar(fs, &currentConfig.GracePeriods.ShutdownSeconds, "shutdown_grace_period", defaultConfig.GracePeriods.ShutdownSeconds, "how long to wait (in seconds) for queries and transactions to complete during graceful shutdown.")
@@ -165,8 +165,8 @@ func registerTabletEnvFlags(fs *pflag.FlagSet) {
 	fs.Int64Var(&currentConfig.ConsolidatorStreamQuerySize, "consolidator-stream-query-size", defaultConfig.ConsolidatorStreamQuerySize, "Configure the stream consolidator query size in bytes. Setting to 0 disables the stream consolidator.")
 	fs.Int64Var(&currentConfig.ConsolidatorStreamTotalSize, "consolidator-stream-total-size", defaultConfig.ConsolidatorStreamTotalSize, "Configure the stream consolidator total size in bytes. Setting to 0 disables the stream consolidator.")
 	flagutil.DualFormatBoolVar(fs, &currentConfig.DeprecatedCacheResultFields, "enable_query_plan_field_caching", defaultConfig.DeprecatedCacheResultFields, "This option fetches & caches fields (columns) when storing query plans")
-	_ = fs.MarkDeprecated("enable_query_plan_field_caching", "This flag is deprecated.")
-	_ = fs.MarkDeprecated("enable-query-plan-field-caching", "This flag is deprecated.")
+	_ = fs.MarkDeprecated("enable_query_plan_field_caching", "it will be removed in a future release.")
+	_ = fs.MarkDeprecated("enable-query-plan-field-caching", "it will be removed in a future release.")
 
 	fs.DurationVar(&healthCheckInterval, "health_check_interval", 20*time.Second, "Interval between health checks")
 	fs.DurationVar(&degradedThreshold, "degraded_threshold", 30*time.Second, "replication lag after which a replica is considered degraded")
diff --git a/web/vtadmin/src/components/routes/Gates.tsx b/web/vtadmin/src/components/routes/Gates.tsx
index 354d4507a3..5e0f0fefd2 100644
--- a/web/vtadmin/src/components/routes/Gates.tsx
+++ b/web/vtadmin/src/components/routes/Gates.tsx
@@ -41,6 +41,7 @@ export const Gates = () => {
             hostname: g.hostname,
             keyspaces: g.keyspaces,
             pool: g.pool,
+            fqdn: g.FQDN,
         }));
         const filtered = filterNouns(filter, mapped);
         return orderBy(filtered, ['cluster', 'pool', 'hostname', 'cell']);
@@ -53,7 +54,17 @@ export const Gates = () => {
                     <div>{gate.pool}</div>
                     <div className="text-sm text-secondary">{gate.cluster}</div>
                 </DataCell>
-                <DataCell className="whitespace-nowrap">{gate.hostname}</DataCell>
+                <DataCell className="whitespace-nowrap">
+                    {gate.fqdn ? (
+                        <div className="font-bold">
+                            <a href={`//${gate.fqdn}`} rel="noopener noreferrer" target="_blank">
+                                {gate.hostname}
+                            </a>
+                        </div>
+                    ) : (
+                        gate.hostname
+                    )}
+                </DataCell>
                 <DataCell className="whitespace-nowrap">{gate.cell}</DataCell>
                 <DataCell>{(gate.keyspaces || []).join(', ')}</DataCell>
             </tr>


Test patch:
diff --git a/go/flags/endtoend/vttestserver.txt b/go/flags/endtoend/vttestserver.txt
index d57114e944..d30ab355ab 100644
--- a/go/flags/endtoend/vttestserver.txt
+++ b/go/flags/endtoend/vttestserver.txt
@@ -134,11 +134,11 @@ Usage of vttestserver:
       --vtgate_grpc_key string                                           the key to use to connect
       --vtgate_grpc_server_name string                                   the server name to use to validate server certificate
       --workflow_manager_init                                            Enable workflow manager
-      --xbstream_restore_flags string                                    flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
-      --xtrabackup_backup_flags string                                   flags to pass to backup command. These should be space separated and will be added to the end of the command
-      --xtrabackup_prepare_flags string                                  flags to pass to prepare command. These should be space separated and will be added to the end of the command
-      --xtrabackup_root_path string                                      directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
-      --xtrabackup_stream_mode string                                    which mode to use if streaming, valid values are tar and xbstream (default "tar")
+      --xbstream_restore_flags string                                    Flags to pass to xbstream command during restore. These should be space separated and will be added to the end of the command. These need to match the ones used for backup e.g. --compress / --decompress, --encrypt / --decrypt
+      --xtrabackup_backup_flags string                                   Flags to pass to backup command. These should be space separated and will be added to the end of the command
+      --xtrabackup_prepare_flags string                                  Flags to pass to prepare command. These should be space separated and will be added to the end of the command
+      --xtrabackup_root_path string                                      Directory location of the xtrabackup and xbstream executables, e.g., /usr/bin
+      --xtrabackup_stream_mode string                                    Which mode to use if streaming, valid values are tar and xbstream. Please note that tar is not supported in XtraBackup 8.0 (default "tar")
       --xtrabackup_stripe_block_size uint                                Size in bytes of each block that gets sent to a given stripe before rotating to the next stripe (default 102400)
       --xtrabackup_stripes uint                                          If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression
       --xtrabackup_user string                                           User that xtrabackup will use to connect to the database server. This user must have all necessary privileges. For details, please refer to xtrabackup documentation.
diff --git a/go/test/endtoend/vtgate/queries/dml/insert_test.go b/go/test/endtoend/vtgate/queries/dml/insert_test.go
index 22ca01d32b..d7c904dee3 100644
--- a/go/test/endtoend/vtgate/queries/dml/insert_test.go
+++ b/go/test/endtoend/vtgate/queries/dml/insert_test.go
@@ -384,3 +384,13 @@ func TestInsertSelectUnshardedUsingSharded(t *testing.T) {
 		})
 	}
 }
+
+func TestRedactDupError(t *testing.T) {
+	mcmp, closer := start(t)
+	defer closer()
+
+	mcmp.Exec("insert into order_tbl(region_id, oid, cust_no) values (1,1,100),(1,2,200),(1,3,300)")
+
+	// inserting same rows, throws error.
+	mcmp.AssertContainsError("insert into order_tbl(region_id, oid, cust_no) select region_id, oid, cust_no from order_tbl", `BindVars: {REDACTED}`)
+}
diff --git a/go/test/endtoend/vtgate/queries/dml/main_test.go b/go/test/endtoend/vtgate/queries/dml/main_test.go
index de3c7897ae..7fb361837f 100644
--- a/go/test/endtoend/vtgate/queries/dml/main_test.go
+++ b/go/test/endtoend/vtgate/queries/dml/main_test.go
@@ -98,6 +98,8 @@ func TestMain(m *testing.M) {
 			return 1
 		}
 
+		clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--vtgate-config-terse-errors")
+
 		// Start vtgate
 		clusterInstance.VtGatePlannerVersion = planbuilder.Gen4
 		err = clusterInstance.StartVtgate()
diff --git a/go/test/endtoend/vtgate/queries/informationschema/informationschema_test.go b/go/test/endtoend/vtgate/queries/informationschema/informationschema_test.go
index be902e5bf0..0b7b72a4f2 100644
--- a/go/test/endtoend/vtgate/queries/informationschema/informationschema_test.go
+++ b/go/test/endtoend/vtgate/queries/informationschema/informationschema_test.go
@@ -38,10 +38,7 @@ func start(t *testing.T) (utils.MySQLCompare, func()) {
 	deleteAll := func() {
 		_, _ = utils.ExecAllowError(t, mcmp.VtConn, "set workload = oltp")
 
-		tables := []string{
-			"t1", "t1_id2_idx", "vstream_test", "t2", "t2_id4_idx", "t3", "t3_id7_idx", "t4",
-			"t4_id2_idx", "t5_null_vindex", "t6", "t6_id2_idx", "t7_xxhash", "t7_xxhash_idx", "t7_fk", "t8",
-		}
+		tables := []string{"t1", "t1_id2_idx", "t7_xxhash", "t7_xxhash_idx", "t7_fk"}
 		for _, table := range tables {
 			_, _ = mcmp.ExecAndIgnore("delete from " + table)
 		}
@@ -206,3 +203,24 @@ func TestMultipleSchemaPredicates(t *testing.T) {
 	require.Error(t, err)
 	require.Contains(t, err.Error(), "specifying two different database in the query is not supported")
 }
+
+func TestInfrSchemaAndUnionAll(t *testing.T) {
+	clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--planner-version=gen4")
+	require.NoError(t,
+		clusterInstance.RestartVtgate())
+
+	vtConnParams := clusterInstance.GetVTParams(keyspaceName)
+	vtConnParams.DbName = keyspaceName
+	conn, err := mysql.Connect(context.Background(), &vtConnParams)
+	require.NoError(t, err)
+
+	for _, workload := range []string{"oltp", "olap"} {
+		t.Run(workload, func(t *testing.T) {
+			utils.Exec(t, conn, fmt.Sprintf("set workload = %s", workload))
+			utils.Exec(t, conn, "start transaction")
+			utils.Exec(t, conn, `select connection_id()`)
+			utils.Exec(t, conn, `(select 'corder' from t1 limit 1) union all (select 'customer' from t7_xxhash limit 1)`)
+			utils.Exec(t, conn, "rollback")
+		})
+	}
+}
diff --git a/go/test/endtoend/vtgate/queries/informationschema/schema.sql b/go/test/endtoend/vtgate/queries/informationschema/schema.sql
index f34e4e8c5b..1fc9949406 100644
--- a/go/test/endtoend/vtgate/queries/informationschema/schema.sql
+++ b/go/test/endtoend/vtgate/queries/informationschema/schema.sql
@@ -12,87 +12,6 @@ create table t1_id2_idx
     primary key (id2)
 ) Engine = InnoDB;
 
-create table vstream_test
-(
-    id  bigint,
-    val bigint,
-    primary key (id)
-) Engine = InnoDB;
-
-create table t2
-(
-    id3 bigint,
-    id4 bigint,
-    primary key (id3)
-) Engine = InnoDB;
-
-create table t2_id4_idx
-(
-    id  bigint not null auto_increment,
-    id4 bigint,
-    id3 bigint,
-    primary key (id),
-    key idx_id4 (id4)
-) Engine = InnoDB;
-
-create table t3
-(
-    id5 bigint,
-    id6 bigint,
-    id7 bigint,
-    primary key (id5)
-) Engine = InnoDB;
-
-create table t3_id7_idx
-(
-    id  bigint not null auto_increment,
-    id7 bigint,
-    id6 bigint,
-    primary key (id)
-) Engine = InnoDB;
-
-create table t4
-(
-    id1 bigint,
-    id2 varchar(10),
-    primary key (id1)
-) ENGINE = InnoDB
-  DEFAULT charset = utf8mb4
-  COLLATE = utf8mb4_general_ci;
-
-create table t4_id2_idx
-(
-    id2         varchar(10),
-    id1         bigint,
-    keyspace_id varbinary(50),
-    primary key (id2, id1)
-) Engine = InnoDB
-  DEFAULT charset = utf8mb4
-  COLLATE = utf8mb4_general_ci;
-
-create table t5_null_vindex
-(
-    id  bigint not null,
-    idx varchar(50),
-    primary key (id)
-) Engine = InnoDB;
-
-create table t6
-(
-    id1 bigint,
-    id2 varchar(10),
-    primary key (id1)
-) Engine = InnoDB;
-
-create table t6_id2_idx
-(
-    id2         varchar(10),
-    id1         bigint,
-    keyspace_id varbinary(50),
-    primary key (id1),
-    key (id2)
-) Engine = InnoDB;
-
 create table t7_xxhash
 (
     uid   varchar(50),
@@ -116,10 +35,3 @@ create table t7_fk
     CONSTRAINT t7_fk_ibfk_1 foreign key (t7_uid) references t7_xxhash (uid)
         on delete set null on update cascade
 ) Engine = InnoDB;
-
-create table t8
-(
-    id8    bigint,
-    testId bigint,
-    primary key (id8)
-) Engine = InnoDB;
diff --git a/go/test/endtoend/vtgate/queries/informationschema/vschema.json b/go/test/endtoend/vtgate/queries/informationschema/vschema.json
index b440e3905d..eec57e9970 100644
--- a/go/test/endtoend/vtgate/queries/informationschema/vschema.json
+++ b/go/test/endtoend/vtgate/queries/informationschema/vschema.json
@@ -7,12 +7,12 @@
     "unicode_loose_xxhash" : {
       "type": "unicode_loose_xxhash"
     },
-    "t3_id7_vdx": {
-      "type": "lookup_hash",
+    "t1_id2_idx": {
+      "type": "lookup_unique",
       "params": {
-        "table": "t3_id7_idx",
-        "from": "id7",
-        "to": "id6"
+        "table": "t1_id2_idx",
+        "from": "id2",
+        "to": "keyspace_id"
       },
       "owner": "t3"
     },
@@ -28,15 +28,15 @@
     }
   },
   "tables": {
-    "t3": {
+    "t1": {
       "column_vindexes": [
         {
-          "column": "id6",
+          "column": "id1",
           "name": "hash"
         },
         {
-          "column": "id7",
-          "name": "t3_id7_vdx"
+          "column": "id2",
+          "name": "t1_id2_idx"
         }
       ]
     },
@@ -48,46 +48,6 @@
         }
       ]
     },
-    "t9": {
-      "column_vindexes": [
-        {
-          "column": "id1",
-          "name": "hash"
-        }
-      ]
-    },
-    "aggr_test": {
-      "column_vindexes": [
-        {
-          "column": "id",
-          "name": "hash"
-        }
-      ],
-      "columns": [
-        {
-          "name": "val1",
-          "type": "VARCHAR"
-        }
-      ]
-    },
-    "aggr_test_dates": {
-      "column_vindexes": [
-        {
-          "column": "id",
-          "name": "hash"
-        }
-      ],
-      "columns": [
-        {
-          "name": "val1",
-          "type": "DATETIME"
-        },
-        {
-          "name": "val2",
-          "type": "DATETIME"
-        }
-      ]
-    },
     "t7_xxhash": {
       "column_vindexes": [
         {
diff --git a/go/test/endtoend/vtgate/sequence/seq_test.go b/go/test/endtoend/vtgate/sequence/seq_test.go
index 0d72b87095..e655b7d703 100644
--- a/go/test/endtoend/vtgate/sequence/seq_test.go
+++ b/go/test/endtoend/vtgate/sequence/seq_test.go
@@ -47,9 +47,9 @@ var (
 	)Engine=InnoDB;
 
 	create table sequence_test_seq (
-		id int default 0, 
-		next_id bigint default null, 
-		cache bigint default null, 
+		id int default 0,
+		next_id bigint default null,
+		cache bigint default null,
 		primary key(id)
 	) comment 'vitess_sequence' Engine=InnoDB;
 
@@ -60,13 +60,13 @@ INSERT INTO id_seq (id, next_id, cache) values (0, 1, 1000);
 	`
 
 	unshardedVSchema = `
-		{	
+		{
 			"sharded":false,
 			"vindexes": {
 				"hash_index": {
 					"type": "hash"
 				}
-			},	
+			},
 			"tables": {
 				"sequence_test":{
 					"auto_increment":{
@@ -147,7 +147,7 @@ CREATE TABLE allDefaults (
 				"column": "id",
 				"sequence": "id_seq"
 			  }
-			},			
+			},
 			"allDefaults": {
 			  "columnVindexes": [
 				{
@@ -264,6 +264,12 @@ func TestSeq(t *testing.T) {
 	if err == nil || !strings.Contains(err.Error(), want) {
 		t.Errorf("wrong insert: %v, must contain %s", err, want)
 	}
+
+	utils.Exec(t, conn, "DELETE FROM sequence_test_seq")
+	qr = utils.Exec(t, conn, "select * from sequence_test_seq")
+	if got, want := fmt.Sprintf("%v", qr.Rows), `[]`; got != want {
+		t.Errorf("select:\n%v want\n%v", got, want)
+	}
 }
 
 func TestDotTableSeq(t *testing.T) {
diff --git a/go/vt/vtgate/engine/fake_vcursor_test.go b/go/vt/vtgate/engine/fake_vcursor_test.go
index e5f4c4dd74..35c90977d4 100644
--- a/go/vt/vtgate/engine/fake_vcursor_test.go
+++ b/go/vt/vtgate/engine/fake_vcursor_test.go
@@ -50,6 +50,10 @@ var _ SessionActions = (*noopVCursor)(nil)
 type noopVCursor struct {
 }
 
+func (t *noopVCursor) InTransaction() bool {
+	return false
+}
+
 func (t *noopVCursor) SetCommitOrder(co vtgatepb.CommitOrder) {
 	//TODO implement me
 	panic("implement me")
diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json
index f4ca59b3ae..ca33db80c9 100644
--- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json
+++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json
@@ -263,6 +263,52 @@
       ]
     }
   },
+  {
+    "comment": "delete from sequence",
+    "query": "DELETE FROM seq",
+    "plan": {
+      "QueryType": "DELETE",
+      "Original": "DELETE FROM seq",
+      "Instructions": {
+        "OperatorType": "Delete",
+        "Variant": "Unsharded",
+        "Keyspace": {
+          "Name": "main",
+          "Sharded": false
+        },
+        "TargetTabletType": "PRIMARY",
+        "MultiShardAutocommit": false,
+        "Query": "delete from seq",
+        "Table": "seq"
+      },
+      "TablesUsed": [
+        "main.seq"
+      ]
+    }
+  },
+  {
+    "comment": "delete from reference table in unsharded keyspace",
+    "query": "DELETE FROM unsharded_ref",
+    "plan": {
+      "QueryType": "DELETE",
+      "Original": "DELETE FROM unsharded_ref",
+      "Instructions": {
+        "OperatorType": "Delete",
+        "Variant": "Unsharded",
+        "Keyspace": {
+          "Name": "main",
+          "Sharded": false
+        },
+        "TargetTabletType": "PRIMARY",
+        "MultiShardAutocommit": false,
+        "Query": "delete from unsharded_ref",
+        "Table": "unsharded_ref"
+      },
+      "TablesUsed": [
+        "main.unsharded_ref"
+      ]
+    }
+  },
   {
     "comment": "update by primary keyspace id",
     "query": "update user set val = 1 where id = 1",
@@ -6154,4 +6200,4 @@
       ]
     }
   }
-]
\ No newline at end of file
+]
diff --git a/go/vt/vtgate/planbuilder/testdata/filter_cases.json b/go/vt/vtgate/planbuilder/testdata/filter_cases.json
index e9ec88d47c..5ba0fea900 100644
--- a/go/vt/vtgate/planbuilder/testdata/filter_cases.json
+++ b/go/vt/vtgate/planbuilder/testdata/filter_cases.json
@@ -6380,5 +6380,79 @@
         "user.user"
       ]
     }
+  },
+  {
+    "comment": "HAVING predicates that use table columns are safe to rewrite if we can move them to the WHERE clause",
+    "query": "select user.col + 2 as a from user having a = 42",
+    "v3-plan": {
+      "QueryType": "SELECT",
+      "Original": "select user.col + 2 as a from user having a = 42",
+      "Instructions": {
+        "OperatorType": "Route",
+        "Variant": "Scatter",
+        "Keyspace": {
+          "Name": "user",
+          "Sharded": true
+        },
+        "FieldQuery": "select `user`.col + 2 as a from `user` where 1 != 1",
+        "Query": "select `user`.col + 2 as a from `user` having a = 42",
+        "Table": "`user`"
+      }
+    },
+    "gen4-plan": {
+      "QueryType": "SELECT",
+      "Original": "select user.col + 2 as a from user having a = 42",
+      "Instructions": {
+        "OperatorType": "Route",
+        "Variant": "Scatter",
+        "Keyspace": {
+          "Name": "user",
+          "Sharded": true
+        },
+        "FieldQuery": "select `user`.col + 2 as a from `user` where 1 != 1",
+        "Query": "select `user`.col + 2 as a from `user` where `user`.col + 2 = 42",
+        "Table": "`user`"
+      },
+      "TablesUsed": [
+        "user.user"
+      ]
+    }
+  },
+  {
+    "comment": "HAVING predicates that use table columns should not get rewritten on unsharded keyspaces",
+    "query": "select col + 2 as a from unsharded having a = 42",
+    "v3-plan": {
+      "QueryType": "SELECT",
+      "Original": "select col + 2 as a from unsharded having a = 42",
+      "Instructions": {
+        "OperatorType": "Route",
+        "Variant": "Unsharded",
+        "Keyspace": {
+          "Name": "main",
+          "Sharded": false
+        },
+        "FieldQuery": "select col + 2 as a from unsharded where 1 != 1",
+        "Query": "select col + 2 as a from unsharded having a = 42",
+        "Table": "unsharded"
+      }
+    },
+    "gen4-plan": {
+      "QueryType": "SELECT",
+      "Original": "select col + 2 as a from unsharded having a = 42",
+      "Instructions": {
+        "OperatorType": "Route",
+        "Variant": "Unsharded",
+        "Keyspace": {
+          "Name": "main",
+          "Sharded": false
+        },
+        "FieldQuery": "select col + 2 as a from unsharded where 1 != 1",
+        "Query": "select col + 2 as a from unsharded having a = 42",
+        "Table": "unsharded"
+      },
+      "TablesUsed": [
+        "main.unsharded"
+      ]
+    }
   }
 ]
diff --git a/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json b/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json
index ed84f369a4..497b3da250 100644
--- a/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json
+++ b/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json
@@ -459,6 +459,9 @@
         },
         "seq": {
           "type": "sequence"
+        },
+        "unsharded_ref": {
+          "type": "reference"
         }
       }
     },
diff --git a/go/vt/vtgate/semantics/early_rewriter_test.go b/go/vt/vtgate/semantics/early_rewriter_test.go
index 9b40227af9..509126efc2 100644
--- a/go/vt/vtgate/semantics/early_rewriter_test.go
+++ b/go/vt/vtgate/semantics/early_rewriter_test.go
@@ -145,7 +145,7 @@ func TestExpandStar(t *testing.T) {
 		expSQL: "select t1.b as b, t1.a as a, t1.c as c, t5.a as a from t1 join t5 where t1.b = t5.b",
 	}, {
 		sql:    "select * from t1 join t5 using (b) having b = 12",
-		expSQL: "select t1.b as b, t1.a as a, t1.c as c, t5.a as a from t1 join t5 where t1.b = t5.b having t1.b = 12",
+		expSQL: "select t1.b as b, t1.a as a, t1.c as c, t5.a as a from t1 join t5 where t1.b = t5.b having b = 12",
 	}, {
 		sql:    "select 1 from t1 join t5 using (b) having b = 12",
 		expSQL: "select 1 from t1 join t5 where t1.b = t5.b having t1.b = 12",