diff --git a/config/tablet/default.yaml b/config/tablet/default.yaml index 15ae27a8521..12c06248e67 100644 --- a/config/tablet/default.yaml +++ b/config/tablet/default.yaml @@ -1,10 +1,10 @@ tabletID: zone-1234 init: - dbName: # init_db_name_override - keyspace: # init_keyspace - shard: # init_shard - tabletType: # init_tablet_type + dbName: # init-db-name-override + keyspace: # init-keyspace + shard: # init-shard + tabletType: # init-tablet-type timeoutSeconds: 60 # init_timeout db: @@ -87,7 +87,7 @@ gracePeriods: replicationTracker: mode: disable # enable_replication_reporter - heartbeatIntervalMilliseconds: 0 # heartbeat_enable, heartbeat_interval + heartbeatIntervalMilliseconds: 0 # heartbeat-enable, heartbeat-interval hotRowProtection: mode: disable|dryRun|enable # enable_hot_row_protection, enable_hot_row_protection_dry_run diff --git a/examples/common/scripts/mysqlctl-down.sh b/examples/common/scripts/mysqlctl-down.sh index b2dee4e2119..62de7df0c4b 100755 --- a/examples/common/scripts/mysqlctl-down.sh +++ b/examples/common/scripts/mysqlctl-down.sh @@ -24,5 +24,6 @@ uid=$TABLET_UID printf -v alias '%s-%010d' $cell $uid echo "Shutting down MySQL for tablet $alias..." + #TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation mysqlctl --tablet_uid $uid shutdown diff --git a/examples/common/scripts/mysqlctl-up.sh b/examples/common/scripts/mysqlctl-up.sh index ff20cae5793..fdec7265905 100755 --- a/examples/common/scripts/mysqlctl-up.sh +++ b/examples/common/scripts/mysqlctl-up.sh @@ -35,6 +35,7 @@ if [ -d $VTDATAROOT/$tablet_dir ]; then action='start' fi +#TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation mysqlctl \ --log_dir $VTDATAROOT/tmp \ --tablet_uid $uid \ diff --git a/examples/common/scripts/vtgate-up.sh b/examples/common/scripts/vtgate-up.sh index a706f6bfcb5..6fabe2d658c 100755 --- a/examples/common/scripts/vtgate-up.sh +++ b/examples/common/scripts/vtgate-up.sh @@ -37,7 +37,7 @@ vtgate \ --mysql_server_socket_path $mysql_server_socket_path \ --cell $cell \ --cells_to_watch $cell \ - --tablet_types_to_wait PRIMARY,REPLICA \ + --tablet-types-to-wait PRIMARY,REPLICA \ --service_map 'grpc-vtgateservice' \ --pid_file $VTDATAROOT/tmp/vtgate.pid \ --enable_buffer \ diff --git a/examples/compose/docker-compose.beginners.yml b/examples/compose/docker-compose.beginners.yml index e2b02a01f2b..e321b70fbb5 100644 --- a/examples/compose/docker-compose.beginners.yml +++ b/examples/compose/docker-compose.beginners.yml @@ -67,7 +67,7 @@ services: $TOPOLOGY_FLAGS \ --cell $CELL \ --service-map 'grpc-vtctl,grpc-vtctld' \ - --backup_storage_implementation file \ + --backup-storage-implementation file \ --file_backup_storage_root /vt/vtdataroot/backups \ --logtostderr=true \ --port $WEB_PORT \ @@ -95,11 +95,11 @@ services: --logtostderr=true \ --port $WEB_PORT \ --grpc-port $GRPC_PORT \ - --mysql_server_port $MYSQL_PORT \ - --mysql_auth_server_impl none \ + --mysql-server-port $MYSQL_PORT \ + --mysql-auth-server-impl none \ --cell $CELL \ --cells_to_watch $CELL \ - --tablet_types_to_wait PRIMARY,REPLICA \ + --tablet-types-to-wait PRIMARY,REPLICA \ --service-map 'grpc-vtgateservice' \ --enable_system_settings=true \ "] diff --git a/examples/compose/docker-compose.yml b/examples/compose/docker-compose.yml index b41962757dd..3c71bff4b23 100644 --- a/examples/compose/docker-compose.yml +++ b/examples/compose/docker-compose.yml @@ -138,7 +138,7 @@ services: - -c - ' /vt/bin/vtctld --topo-implementation consul --topo-global-server-address consul1:8500 --topo-global-root vitess/global --cell test - --service-map ''grpc-vtctl,grpc-vtctld'' --backup_storage_implementation file --file_backup_storage_root + --service-map ''grpc-vtctl,grpc-vtctld'' --backup-storage-implementation file --file_backup_storage_root /vt/vtdataroot/backups --logtostderr=true --port 8080 --grpc-port 15999 ' depends_on: external_db_host: @@ -155,8 +155,8 @@ services: - -c - '/script/run-forever.sh /vt/bin/vtgate --topo-implementation consul --topo-global-server-address consul1:8500 --topo-global-root vitess/global --logtostderr=true --port 8080 --grpc-port - 15999 --mysql_server_port 15306 --mysql_auth_server_impl none --cell test --cells_to_watch - test --tablet_types_to_wait PRIMARY,REPLICA,RDONLY --service-map ''grpc-vtgateservice'' + 15999 --mysql-server-port 15306 --mysql-auth-server-impl none --cell test --cells_to_watch + test --tablet-types-to-wait PRIMARY,REPLICA,RDONLY --service-map ''grpc-vtgateservice'' --normalize_queries=true ' depends_on: - vtctld diff --git a/examples/compose/vtcompose/docker-compose.test.yml b/examples/compose/vtcompose/docker-compose.test.yml index 978f632c164..ec12265e222 100644 --- a/examples/compose/vtcompose/docker-compose.test.yml +++ b/examples/compose/vtcompose/docker-compose.test.yml @@ -152,10 +152,10 @@ services: - sh - -c - ' /vt/bin/vtctld --topo-implementation consul --topo-global-server-address consul1:8500 - --topo-global-root vitess/global --cell test - --service-map ''grpc-vtctl,grpc-vtctld'' --backup_storage_implementation file - --file_backup_storage_root /vt/vtdataroot/backups --logtostderr=true --port - 8080 --grpc-port 15999 ' + --topo-global-root vitess/global --cell test + --service-map ''grpc-vtctl,grpc-vtctld'' --backup-storage-implementation file + --file_backup_storage_root /vt/vtdataroot/backups --logtostderr=true --port + 8080 --grpc-port 15999 ' depends_on: external_db_host: condition: service_healthy @@ -170,10 +170,10 @@ services: - sh - -c - '/script/run-forever.sh /vt/bin/vtgate --topo-implementation consul --topo-global-server-address - consul1:8500 --topo-global-root vitess/global --logtostderr=true --port 8080 - --grpc-port 15999 --mysql_server_port 15306 --mysql_auth_server_impl none --cell - test --cells_to_watch test --tablet_types_to_wait PRIMARY,REPLICA,RDONLY --service-map - ''grpc-vtgateservice'' --normalize_queries=true ' + consul1:8500 --topo-global-root vitess/global --logtostderr=true --port 8080 + --grpc-port 15999 --mysql-server-port 15306 --mysql-auth-server-impl none --cell + test --cells_to_watch test --tablet-types-to-wait PRIMARY,REPLICA,RDONLY --service-map + ''grpc-vtgateservice'' --normalize_queries=true ' depends_on: - vtctld image: vitess/lite:${VITESS_TAG:-latest} diff --git a/examples/compose/vtcompose/vtcompose.go b/examples/compose/vtcompose/vtcompose.go index 678acdf9dd1..ab95d7f59c1 100644 --- a/examples/compose/vtcompose/vtcompose.go +++ b/examples/compose/vtcompose/vtcompose.go @@ -633,7 +633,7 @@ func generateVtctld(opts vtOptions) string { %[3]s \ --cell %[4]s \ --service-map 'grpc-vtctl,grpc-vtctld' \ - --backup_storage_implementation file \ + --backup-storage-implementation file \ --file_backup_storage_root /vt/vtdataroot/backups \ --logtostderr=true \ --port %[1]d \ @@ -666,11 +666,11 @@ func generateVtgate(opts vtOptions) string { --logtostderr=true \ --port %[1]d \ --grpc-port %[2]d \ - --mysql_server_port %[3]d \ - --mysql_auth_server_impl none \ + --mysql-server-port %[3]d \ + --mysql-auth-server-impl none \ --cell %[5]s \ --cells_to_watch %[5]s \ - --tablet_types_to_wait PRIMARY,REPLICA,RDONLY \ + --tablet-types-to-wait PRIMARY,REPLICA,RDONLY \ --service-map 'grpc-vtgateservice' \ --normalize_queries=true \ "] diff --git a/examples/compose/vttablet-up.sh b/examples/compose/vttablet-up.sh index 1c9f7720748..709f92b9db4 100755 --- a/examples/compose/vttablet-up.sh +++ b/examples/compose/vttablet-up.sh @@ -95,6 +95,7 @@ rm -rf $VTDATAROOT/$tablet_dir/{mysql.sock,mysql.sock.lock} # Create mysql instances # Do not create mysql instance for primary if connecting to external mysql database +#TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation if [[ $tablet_role != "externalprimary" ]]; then echo "Initing mysql for tablet: $uid role: $role external: $external.. " $VTROOT/bin/mysqlctld \ diff --git a/go/cmd/mysqlctl/command/init.go b/go/cmd/mysqlctl/command/init.go index afaf1c566df..eac1c87ff4e 100644 --- a/go/cmd/mysqlctl/command/init.go +++ b/go/cmd/mysqlctl/command/init.go @@ -33,8 +33,8 @@ var Init = &cobra.Command{ "The MySQL version and flavor will be auto-detected, with a minimal configuration file applied.", Example: `mysqlctl \ --alsologtostderr \ - --tablet_uid 101 \ - --mysql_port 12345 \ + --tablet-uid 101 \ + --mysql-port 12345 \ init`, Args: cobra.NoArgs, RunE: commandInit, diff --git a/go/cmd/mysqlctl/command/init_config.go b/go/cmd/mysqlctl/command/init_config.go index 36687482e08..39594f93f14 100644 --- a/go/cmd/mysqlctl/command/init_config.go +++ b/go/cmd/mysqlctl/command/init_config.go @@ -31,8 +31,8 @@ var InitConfig = &cobra.Command{ "This command is the same as `init` except the `mysqld` server will not be started.", Example: `mysqlctl \ --alsologtostderr \ - --tablet_uid 101 \ - --mysql_port 12345 \ + --tablet-uid 101 \ + --mysql-port 12345 \ init_config`, Args: cobra.NoArgs, RunE: commandInitConfig, diff --git a/go/cmd/mysqlctl/command/reinit_config.go b/go/cmd/mysqlctl/command/reinit_config.go index fd7523c0411..cf718979adf 100644 --- a/go/cmd/mysqlctl/command/reinit_config.go +++ b/go/cmd/mysqlctl/command/reinit_config.go @@ -32,8 +32,8 @@ var ReinitConfig = &cobra.Command{ "This could be helpful to revert configuration changes, or to pick up changes made to the bundled config in newer Vitess versions.", Example: `mysqlctl \ --alsologtostderr \ - --tablet_uid 101 \ - --mysql_port 12345 \ + --tablet-uid 101 \ + --mysql-port 12345 \ reinit_config`, Args: cobra.NoArgs, RunE: commandReinitConfig, diff --git a/go/cmd/mysqlctl/command/root.go b/go/cmd/mysqlctl/command/root.go index 78b3a623666..192c9f0ee1c 100644 --- a/go/cmd/mysqlctl/command/root.go +++ b/go/cmd/mysqlctl/command/root.go @@ -27,6 +27,7 @@ import ( "vitess.io/vitess/go/vt/dbconfigs" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -70,9 +71,9 @@ func init() { servenv.MovePersistentFlagsToCobraCommand(Root) - Root.PersistentFlags().IntVar(&mysqlPort, "mysql_port", mysqlPort, "MySQL port.") - Root.PersistentFlags().Uint32Var(&tabletUID, "tablet_uid", tabletUID, "Tablet UID.") - Root.PersistentFlags().StringVar(&mysqlSocket, "mysql_socket", mysqlSocket, "Path to the mysqld socket file.") + utils.SetFlagIntVar(Root.PersistentFlags(), &mysqlPort, "mysql-port", mysqlPort, "MySQL port.") + utils.SetFlagUint32Var(Root.PersistentFlags(), &tabletUID, "tablet-uid", tabletUID, "Tablet UID.") + utils.SetFlagStringVar(Root.PersistentFlags(), &mysqlSocket, "mysql-socket", mysqlSocket, "Path to the mysqld socket file.") acl.RegisterFlags(Root.PersistentFlags()) diff --git a/go/cmd/mysqlctl/command/shutdown.go b/go/cmd/mysqlctl/command/shutdown.go index 30e0c8c0f8e..725fc061b88 100644 --- a/go/cmd/mysqlctl/command/shutdown.go +++ b/go/cmd/mysqlctl/command/shutdown.go @@ -31,7 +31,7 @@ var Shutdown = &cobra.Command{ Short: "Shuts down mysqld, without removing any files.", Long: "Stop a `mysqld` instance that was previously started with `init` or `start`.\n\n" + "For large `mysqld` instances, you may need to extend the `wait_time` to shutdown cleanly.", - Example: `mysqlctl --tablet_uid 101 --alsologtostderr shutdown`, + Example: `mysqlctl --tablet-uid 101 --alsologtostderr shutdown`, Args: cobra.NoArgs, RunE: commandShutdown, } diff --git a/go/cmd/mysqlctl/command/start.go b/go/cmd/mysqlctl/command/start.go index aff8d723a8b..662a110c8cd 100644 --- a/go/cmd/mysqlctl/command/start.go +++ b/go/cmd/mysqlctl/command/start.go @@ -31,7 +31,7 @@ var Start = &cobra.Command{ Use: "start", Short: "Starts mysqld on an already 'init'-ed directory.", Long: "Resume an existing `mysqld` instance that was previously bootstrapped with `init` or `init_config`", - Example: `mysqlctl --tablet_uid 101 --alsologtostderr start`, + Example: `mysqlctl --tablet-uid 101 --alsologtostderr start`, Args: cobra.NoArgs, RunE: commandStart, } diff --git a/go/cmd/mysqlctl/command/teardown.go b/go/cmd/mysqlctl/command/teardown.go index 3e7e7bfd0ef..77a653bd030 100644 --- a/go/cmd/mysqlctl/command/teardown.go +++ b/go/cmd/mysqlctl/command/teardown.go @@ -33,7 +33,7 @@ var Teardown = &cobra.Command{ "This is a destructive operation.\n" + "{{}}\n\n" + "Shuts down a `mysqld` instance and removes its data directory.", - Example: `mysqlctl --tablet_uid 101 --alsologtostderr teardown`, + Example: `mysqlctl --tablet-uid 101 --alsologtostderr teardown`, Args: cobra.NoArgs, RunE: commandTeardown, } diff --git a/go/cmd/mysqlctld/cli/mysqlctld.go b/go/cmd/mysqlctld/cli/mysqlctld.go index ee3fe241440..94861edf27c 100644 --- a/go/cmd/mysqlctld/cli/mysqlctld.go +++ b/go/cmd/mysqlctld/cli/mysqlctld.go @@ -34,6 +34,7 @@ import ( "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -63,8 +64,8 @@ var ( "To enable communication with a `vttablet`, the server must be configured to receive gRPC messages on a unix domain socket.", Example: `mysqlctld \ --log_dir=${VTDATAROOT}/logs \ - --tablet_uid=100 \ - --mysql_port=17100 \ + --tablet-uid=100 \ + --mysql-port=17100 \ --socket_file=/path/to/socket_file`, Args: cobra.NoArgs, Version: servenv.AppVersion.String(), @@ -91,9 +92,9 @@ func init() { servenv.MoveFlagsToCobraCommand(Main) - Main.Flags().IntVar(&mysqlPort, "mysql_port", mysqlPort, "MySQL port") - Main.Flags().Uint32Var(&tabletUID, "tablet_uid", tabletUID, "Tablet UID") - Main.Flags().StringVar(&mysqlSocket, "mysql_socket", mysqlSocket, "Path to the mysqld socket file") + utils.SetFlagIntVar(Main.Flags(), &mysqlPort, "mysql-port", mysqlPort, "MySQL port") + utils.SetFlagUint32Var(Main.Flags(), &tabletUID, "tablet-uid", tabletUID, "Tablet UID") + utils.SetFlagStringVar(Main.Flags(), &mysqlSocket, "mysql-socket", mysqlSocket, "Path to the mysqld socket file") Main.Flags().DurationVar(&waitTime, "wait_time", waitTime, "How long to wait for mysqld startup") Main.Flags().StringVar(&initDBSQLFile, "init_db_sql_file", initDBSQLFile, "Path to .sql file to run after mysqld initialization") Main.Flags().DurationVar(&shutdownWaitTime, "shutdown-wait-time", shutdownWaitTime, "How long to wait for mysqld shutdown") diff --git a/go/cmd/vtbackup/cli/vtbackup.go b/go/cmd/vtbackup/cli/vtbackup.go index 3dd82801d45..a4e7fba9798 100644 --- a/go/cmd/vtbackup/cli/vtbackup.go +++ b/go/cmd/vtbackup/cli/vtbackup.go @@ -46,6 +46,7 @@ import ( "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" _ "vitess.io/vitess/go/vt/vttablet/grpctmclient" "vitess.io/vitess/go/vt/vttablet/tmclient" @@ -209,15 +210,15 @@ func init() { Main.Flags().BoolVar(&upgradeSafe, "upgrade-safe", upgradeSafe, "Whether to use innodb_fast_shutdown=0 for the backup so it is safe to use for MySQL upgrades.") // vttablet-like flags - Main.Flags().StringVar(&initDbNameOverride, "init_db_name_override", initDbNameOverride, "(init parameter) override the name of the db used by vttablet") - Main.Flags().StringVar(&initKeyspace, "init_keyspace", initKeyspace, "(init parameter) keyspace to use for this tablet") - Main.Flags().StringVar(&initShard, "init_shard", initShard, "(init parameter) shard to use for this tablet") + utils.SetFlagStringVar(Main.Flags(), &initDbNameOverride, "init-db-name-override", initDbNameOverride, "(init parameter) override the name of the db used by vttablet") + utils.SetFlagStringVar(Main.Flags(), &initKeyspace, "init-keyspace", initKeyspace, "(init parameter) keyspace to use for this tablet") + utils.SetFlagStringVar(Main.Flags(), &initShard, "init-shard", initShard, "(init parameter) shard to use for this tablet") Main.Flags().IntVar(&concurrency, "concurrency", concurrency, "(init restore parameter) how many concurrent files to restore at once") Main.Flags().StringVar(&incrementalFromPos, "incremental_from_pos", incrementalFromPos, "Position, or name of backup from which to create an incremental backup. Default: empty. If given, then this backup becomes an incremental backup from given position or given backup. If value is 'auto', this backup will be taken from the last successful backup position.") // mysqlctld-like flags - Main.Flags().IntVar(&mysqlPort, "mysql_port", mysqlPort, "mysql port") - Main.Flags().StringVar(&mysqlSocket, "mysql_socket", mysqlSocket, "path to the mysql socket") + utils.SetFlagIntVar(Main.Flags(), &mysqlPort, "mysql-port", mysqlPort, "MySQL port") + utils.SetFlagStringVar(Main.Flags(), &mysqlSocket, "mysql-socket", mysqlSocket, "Path to the mysqld socket file") Main.Flags().DurationVar(&mysqlTimeout, "mysql_timeout", mysqlTimeout, "how long to wait for mysqld startup") Main.Flags().DurationVar(&mysqlShutdownTimeout, "mysql-shutdown-timeout", mysqlShutdownTimeout, "how long to wait for mysqld shutdown") Main.Flags().StringVar(&initDBSQLFile, "init_db_sql_file", initDBSQLFile, "path to .sql file to run after mysql_install_db") diff --git a/go/cmd/vtcombo/cli/main.go b/go/cmd/vtcombo/cli/main.go index 013090d6414..c65e87e94ba 100644 --- a/go/cmd/vtcombo/cli/main.go +++ b/go/cmd/vtcombo/cli/main.go @@ -44,6 +44,7 @@ import ( "vitess.io/vitess/go/vt/topo/memorytopo" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/topotools" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtcombo" "vitess.io/vitess/go/vt/vtctld" "vitess.io/vitess/go/vt/vtenv" @@ -106,7 +107,7 @@ func init() { Main.Flags().StringVar(&schemaDir, "schema_dir", schemaDir, "Schema base directory. Should contain one directory per keyspace, with a vschema.json file if necessary.") Main.Flags().BoolVar(&startMysql, "start_mysql", startMysql, "Should vtcombo also start mysql") - Main.Flags().IntVar(&mysqlPort, "mysql_port", mysqlPort, "mysql port") + utils.SetFlagIntVar(Main.Flags(), &mysqlPort, "mysql-port", mysqlPort, "mysql port") Main.Flags().BoolVar(&externalTopoServer, "external_topo_server", externalTopoServer, "Should vtcombo use an external topology server instead of starting its own in-memory topology server. "+ "If true, vtcombo will use the flags defined in topo/server.go to open topo server") Main.Flags().StringVar(&plannerName, "planner-version", plannerName, "Sets the default planner to use when the session has not changed it. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right") @@ -120,11 +121,11 @@ func init() { Main.Flags().Var(vttest.TextTopoData(&tpb), "proto_topo", "vttest proto definition of the topology, encoded in compact text format. See vttest.proto for more information.") Main.Flags().Var(vttest.JSONTopoData(&tpb), "json_topo", "vttest proto definition of the topology, encoded in json format. See vttest.proto for more information.") - Main.Flags().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.") + utils.SetFlagVar(Main.Flags(), (*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.") // We're going to force the value later, so don't even bother letting the // user know about this flag. - Main.Flags().MarkHidden("tablet_protocol") + Main.Flags().MarkHidden("tablet-protocol") srvTopoCounts = stats.NewCountersWithSingleLabel("ResilientSrvTopoServer", "Resilient srvtopo server operations", "type") } @@ -241,11 +242,11 @@ func run(cmd *cobra.Command, args []string) (err error) { // Tablet configuration and init. // Send mycnf as nil because vtcombo won't do backups and restores. // - // Also force the `--tablet-manager-protocol` and `--tablet_protocol` flags + // Also force the `--tablet-manager-protocol` and `--tablet-protocol` flags // to be the "internal" protocol that InitTabletMap registers. cmd.Flags().Set("tablet-manager-protocol", "internal") - cmd.Flags().Set("tablet_protocol", "internal") + cmd.Flags().Set("tablet-protocol", "internal") uid, err := vtcombo.InitTabletMap(env, ts, &tpb, mysqld, &dbconfigs.GlobalDBConfigs, schemaDir, startMysql, srvTopoCounts) if err != nil { // ensure we start mysql in the event we fail here @@ -321,7 +322,7 @@ func run(cmd *cobra.Command, args []string) (err error) { } if len(tabletTypes) == 0 { - log.Exitf("tablet_types_to_wait should contain at least one serving tablet type") + log.Exitf("tablet-types-to-wait should contain at least one serving tablet type") } } else { tabletTypes = append(tabletTypes, topodatapb.TabletType_PRIMARY, topodatapb.TabletType_REPLICA, topodatapb.TabletType_RDONLY) diff --git a/go/cmd/vtctld/cli/cli.go b/go/cmd/vtctld/cli/cli.go index 17af2dbd0f6..55176df21fc 100644 --- a/go/cmd/vtctld/cli/cli.go +++ b/go/cmd/vtctld/cli/cli.go @@ -44,7 +44,7 @@ This is demonstrated in the example usage below.`, --topo-global-server-address localhost:2379 \ --topo-global-root /vitess/ \ --service-map 'grpc-vtctl,grpc-vtctld' \ - --backup_storage_implementation file \ + --backup-storage-implementation file \ --file_backup_storage_root $VTDATAROOT/backups \ --port 15000 \ --grpc-port 15999`, diff --git a/go/cmd/vtgate/cli/cli.go b/go/cmd/vtgate/cli/cli.go index 91d090758e1..3261e703fb3 100644 --- a/go/cmd/vtgate/cli/cli.go +++ b/go/cmd/vtgate/cli/cli.go @@ -31,6 +31,7 @@ import ( "vitess.io/vitess/go/vt/srvtopo" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtenv" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate" @@ -53,7 +54,7 @@ var ( ### Key Options ` + - "\n* `--srv_topo_cache_ttl`: There may be instances where you will need to increase the cached TTL from the default of 1 second to a higher number:\n" + + "\n* `--srv-topo-cache-ttl`: There may be instances where you will need to increase the cached TTL from the default of 1 second to a higher number:\n" + ` * You may want to increase this option if you see that your topo leader goes down and keeps your queries waiting for a few seconds.`, Example: `vtgate \ --topo-implementation etcd2 \ @@ -62,13 +63,13 @@ var ( --log_dir $VTDATAROOT/tmp \ --port 15001 \ --grpc-port 15991 \ - --mysql_server_port 15306 \ + --mysql-server-port 15306 \ --cell test \ --cells_to_watch test \ - --tablet_types_to_wait PRIMARY,REPLICA \ + --tablet-types-to-wait PRIMARY,REPLICA \ --service-map 'grpc-vtgateservice' \ --pid-file $VTDATAROOT/tmp/vtgate.pid \ - --mysql_auth_server_impl none`, + --mysql-auth-server-impl none`, Args: cobra.NoArgs, Version: servenv.AppVersion.String(), PreRunE: servenv.CobraPreRunE, @@ -162,7 +163,7 @@ func run(cmd *cobra.Command, args []string) error { } if len(tabletTypes) == 0 { - return fmt.Errorf("tablet_types_to_wait must contain at least one serving tablet type") + return fmt.Errorf("tablet-types-to-wait must contain at least one serving tablet type") } err := CheckCellFlags(ctx, resilientServer, cell, vtgate.CellsToWatch) @@ -208,8 +209,11 @@ func init() { acl.RegisterFlags(Main.Flags()) Main.Flags().StringVar(&cell, "cell", cell, "cell to use") - Main.Flags().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.") + utils.SetFlagVar(Main.Flags(), (*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.") Main.Flags().StringVar(&plannerName, "planner-version", plannerName, "Sets the default planner to use when the session has not changed it. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right") - Main.MarkFlagRequired("tablet_types_to_wait") + // Support both variants until v25 + // Main.MarkFlagRequired("tablet-types-to-wait") + Main.MarkFlagsOneRequired("tablet-types-to-wait", "tablet_types_to_wait") + } diff --git a/go/cmd/vttablet/cli/cli.go b/go/cmd/vttablet/cli/cli.go index 9cfa20d6802..a61cd394d99 100644 --- a/go/cmd/vttablet/cli/cli.go +++ b/go/cmd/vttablet/cli/cli.go @@ -81,17 +81,17 @@ Even if a MySQL is external, you can still make vttablet perform some management ` + "* `--unmanaged`: This flag indicates that this tablet is running in unmanaged mode. In this mode, any reparent or replica commands are not allowed. These are InitShardPrimary, PlannedReparentShard, EmergencyReparentShard, and ReparentTablet. You should use the TabletExternallyReparented command to inform vitess of the current primary.\n" + - "* `--replication_connect_retry`: This value is give to mysql when it connects a replica to the primary as the retry duration parameter.\n" + - "* `--heartbeat_enable` and `--heartbeat_interval duration`: cause vttablet to write heartbeats to the sidecar database. This information is also used by the replication reporter to assess replica lag.\n", + "* `--replication-connect-retry`: This value is give to mysql when it connects a replica to the primary as the retry duration parameter.\n" + + "* `--heartbeat-enable` and `--heartbeat-interval duration`: cause vttablet to write heartbeats to the sidecar database. This information is also used by the replication reporter to assess replica lag.\n", Example: ` vttablet \ --topo-implementation etcd2 \ --topo-global-server-address localhost:2379 \ --topo-global-root /vitess/ \ --tablet-path $alias \ - --init_keyspace $keyspace \ - --init_shard $shard \ - --init_tablet_type $tablet_type \ + --init-keyspace $keyspace \ + --init-shard $shard \ + --init-tablet-type $tablet_type \ --port $port \ --grpc-port $grpc_port \ --service-map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream'` + "\n\n`$alias` needs to be of the form: `-id`, and the cell should match one of the local cells that was created in the topology. The id can be left padded with zeroes: `cell-100` and `cell-000000100` are synonymous.", diff --git a/go/cmd/vttablet/cli/cli_test.go b/go/cmd/vttablet/cli/cli_test.go index 01f6709fe65..f4685d9bc03 100644 --- a/go/cmd/vttablet/cli/cli_test.go +++ b/go/cmd/vttablet/cli/cli_test.go @@ -49,6 +49,9 @@ func TestRunFailsToStartTabletManager(t *testing.T) { utils.SetFlagVariantsForTests(flags, "--topo-global-root", "cell") utils.SetFlagVariantsForTests(flags, "--db-host", "localhost") utils.SetFlagVariantsForTests(flags, "--db-port", "3306") + utils.SetFlagVariantsForTests(flags, "--init-keyspace", "ks") + utils.SetFlagVariantsForTests(flags, "--init-shard", "0") + utils.SetFlagVariantsForTests(flags, "--init-tablet-type", "replica") var flagArgs []string for flag, value := range flags { @@ -56,9 +59,7 @@ func TestRunFailsToStartTabletManager(t *testing.T) { } flagArgs = append(flagArgs, - "--tablet-path", "cell-1", "--init_keyspace", "ks", - "--init_shard", "0", "--init_tablet_type", "replica", - "--restore_from_backup", + "--tablet-path", "cell-1", "--restore_from_backup", ) os.Args = append([]string{"vttablet"}, flagArgs...) diff --git a/go/cmd/vttestserver/cli/main.go b/go/cmd/vttestserver/cli/main.go index 479ea4441f8..578e6b2c1db 100644 --- a/go/cmd/vttestserver/cli/main.go +++ b/go/cmd/vttestserver/cli/main.go @@ -34,6 +34,7 @@ import ( "vitess.io/vitess/go/acl" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vttest" vttestpb "vitess.io/vitess/go/vt/proto/vttest" @@ -146,35 +147,35 @@ func New() (cmd *cobra.Command) { " when LocalCluster.TearDown() is called. This is useful for running"+ " vttestserver as a database container in local developer environments. Note"+ " that db migration files (--schema_dir option) and seeding of"+ - " random data (--initialize_with_random_data option) will only run during"+ + " random data (--initialize-with-random-data option) will only run during"+ " cluster startup if the data directory does not already exist. "+ " Changes to VSchema are persisted across cluster restarts using a simple"+ " watcher if the --data_dir argument is specified.") - cmd.Flags().BoolVar(&doSeed, "initialize_with_random_data", false, + utils.SetFlagBoolVar(cmd.Flags(), &doSeed, "initialize-with-random-data", false, "If this flag is each table-shard will be initialized"+ " with random data. See also the 'rng_seed' and 'min_shard_size'"+ " and 'max_shard_size' flags.") cmd.Flags().IntVar(&seed.RngSeed, "rng_seed", 123, "The random number generator seed to use when initializing"+ - " with random data (see also --initialize_with_random_data)."+ + " with random data (see also --initialize-with-random-data)."+ " Multiple runs with the same seed will result with the same"+ " initial data.") cmd.Flags().IntVar(&seed.MinSize, "min_table_shard_size", 1000, "The minimum number of initial rows in a table shard. Ignored if"+ - "--initialize_with_random_data is false. The actual number is chosen"+ + "--initialize-with-random-data is false. The actual number is chosen"+ " randomly.") cmd.Flags().IntVar(&seed.MaxSize, "max_table_shard_size", 10000, "The maximum number of initial rows in a table shard. Ignored if"+ - "--initialize_with_random_data is false. The actual number is chosen"+ + "--initialize-with-random-data is false. The actual number is chosen"+ " randomly") cmd.Flags().Float64Var(&seed.NullProbability, "null_probability", 0.1, "The probability to initialize a field with 'NULL' "+ - " if --initialize_with_random_data is true. Only applies to fields"+ + " if --initialize-with-random-data is true. Only applies to fields"+ " that can contain NULL values.") cmd.Flags().StringVar(&config.MySQLBindHost, "mysql_bind_host", "localhost", @@ -208,7 +209,7 @@ func New() (cmd *cobra.Command) { cmd.Flags().StringVar(&config.TransactionMode, "transaction_mode", "MULTI", "Transaction mode MULTI (default), SINGLE or TWOPC ") cmd.Flags().DurationVar(&config.TransactionTimeout, "queryserver-config-transaction-timeout", 30*time.Second, "query server transaction timeout, a transaction will be killed if it takes longer than this value") - cmd.Flags().StringVar(&config.TabletHostName, "tablet_hostname", "localhost", "The hostname to use for the tablet otherwise it will be derived from OS' hostname") + utils.SetFlagStringVar(cmd.Flags(), &config.TabletHostName, "tablet-hostname", "localhost", "The hostname to use for the tablet otherwise it will be derived from OS' hostname") cmd.Flags().StringVar(&config.VSchemaDDLAuthorizedUsers, "vschema_ddl_authorized_users", "", "Comma separated list of users authorized to execute vschema ddl operations via vtgate") @@ -221,7 +222,7 @@ func New() (cmd *cobra.Command) { cmd.Flags().StringVar(&config.ExternalTopoGlobalServerAddress, "external_topo_global_server_address", "", "the address of the global topology server for vtcombo process") cmd.Flags().StringVar(&config.ExternalTopoGlobalRoot, "external_topo_global_root", "", "the path of the global topology data in the global topology server for vtcombo process") - cmd.Flags().DurationVar(&config.VtgateTabletRefreshInterval, "tablet_refresh_interval", 10*time.Second, "Interval at which vtgate refreshes tablet information from topology server.") + utils.SetFlagDurationVar(cmd.Flags(), &config.VtgateTabletRefreshInterval, "tablet-refresh-interval", 10*time.Second, "Interval at which vtgate refreshes tablet information from topology server.") cmd.Flags().BoolVar(&doCreateTCPUser, "initialize-with-vt-dba-tcp", false, "If this flag is enabled, MySQL will be initialized with an additional user named vt_dba_tcp, who will have access via TCP/IP connection.") diff --git a/go/cmd/vttestserver/cli/main_test.go b/go/cmd/vttestserver/cli/main_test.go index 6be0cdc3eed..15e73e0db4f 100644 --- a/go/cmd/vttestserver/cli/main_test.go +++ b/go/cmd/vttestserver/cli/main_test.go @@ -39,7 +39,6 @@ import ( "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/tlstest" "vitess.io/vitess/go/vt/utils" - "vitess.io/vitess/go/vt/vtctl/vtctlclient" "vitess.io/vitess/go/vt/vttest" @@ -378,7 +377,7 @@ var clusterKeyspaces = []string{ func startCluster(flags ...string) (cluster vttest.LocalCluster, err error) { args := []string{"vttestserver"} schemaDirArg := "--schema_dir=data/schema" - tabletHostname := "--tablet_hostname=localhost" + tabletHostname := fmt.Sprintf("%s=localhost", utils.GetFlagVariantForTests("--tablet-hostname")) keyspaceArg := "--keyspaces=" + strings.Join(clusterKeyspaces, ",") numShardsArg := "--num_shards=2,2" vschemaDDLAuthorizedUsers := "--vschema_ddl_authorized_users=%" diff --git a/go/flags/endtoend/mysqlctl.txt b/go/flags/endtoend/mysqlctl.txt index 7dff92eff62..88b396d8717 100644 --- a/go/flags/endtoend/mysqlctl.txt +++ b/go/flags/endtoend/mysqlctl.txt @@ -70,27 +70,27 @@ Flags: --log_dir string If non-empty, write log files in this directory --logtostderr log to standard error instead of files --max-stack-size int configure the maximum stack size in bytes (default 67108864) + --mysql-port int MySQL port. (default 3306) --mysql-server-version string MySQL server version to advertise. (default "8.0.40-Vitess") - --mysql_port int MySQL port. (default 3306) - --mysql_socket string Path to the mysqld socket file. + --mysql-socket string Path to the mysqld socket file. --mysqlctl_client_protocol string the protocol to use to talk to the mysqlctl server (default "grpc") --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 10s) --onterm-timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) --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) + --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 --pprof-http enable pprof http endpoints --purge-logs-interval duration how often try to remove old logs (default 1h0m0s) - --replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) + --replication-connect-retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) --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) --service-map strings comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice --socket_file string Local unix socket file to listen on --stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1) --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class --tablet-dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. - --tablet_uid uint32 Tablet UID. (default 41983) + --tablet-uid uint32 Tablet UID. (default 41983) --v Level log level for V logs -v, --version print binary version --vmodule vModuleFlag comma-separated list of pattern=N settings for file-filtered logging diff --git a/go/flags/endtoend/mysqlctld.txt b/go/flags/endtoend/mysqlctld.txt index 8fb5d36e746..22697762078 100644 --- a/go/flags/endtoend/mysqlctld.txt +++ b/go/flags/endtoend/mysqlctld.txt @@ -14,8 +14,8 @@ Usage: Examples: mysqlctld \ --log_dir=${VTDATAROOT}/logs \ - --tablet_uid=100 \ - --mysql_port=17100 \ + --tablet-uid=100 \ + --mysql-port=17100 \ --socket_file=/path/to/socket_file Flags: @@ -98,20 +98,20 @@ Flags: --log_dir string If non-empty, write log files in this directory --logtostderr log to standard error instead of files --max-stack-size int configure the maximum stack size in bytes (default 67108864) + --mysql-port int MySQL port (default 3306) --mysql-server-version string MySQL server version to advertise. (default "8.0.40-Vitess") - --mysql_port int MySQL port (default 3306) - --mysql_socket string Path to the mysqld socket file + --mysql-socket string Path to the mysqld socket file --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 10s) --onterm-timeout duration wait no more than this for OnTermSync handlers before stopping (default 5m10s) --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) + --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 --pprof-http enable pprof http endpoints --purge-logs-interval duration how often try to remove old logs (default 1h0m0s) - --replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) + --replication-connect-retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) --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) --service-map strings comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice --shutdown-wait-time duration How long to wait for mysqld shutdown (default 5m0s) @@ -119,7 +119,7 @@ Flags: --stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1) --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class --tablet-dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. - --tablet_uid uint32 Tablet UID (default 41983) + --tablet-uid uint32 Tablet UID (default 41983) --v Level log level for V logs -v, --version print binary version --vmodule vModuleFlag comma-separated list of pattern=N settings for file-filtered logging diff --git a/go/flags/endtoend/vtbackup.txt b/go/flags/endtoend/vtbackup.txt index 76bc787de67..c2b0181d822 100644 --- a/go/flags/endtoend/vtbackup.txt +++ b/go/flags/endtoend/vtbackup.txt @@ -50,23 +50,23 @@ Usage: Flags: --allow_first_backup Allow this job to take the first backup of an existing shard. --alsologtostderr log to standard error as well as files - --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_buffer_size int The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service. (default 104857600) - --azblob_backup_container_name string Azure Blob Container Name. - --azblob_backup_parallelism int Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob_backup_buffer_size). (default 1) - --azblob_backup_storage_root string Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/'). - --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 true) - --backup_storage_implementation string Which backup storage implementation to use for creating and restoring backups. - --backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) + --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-buffer-size int The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service. (default 104857600) + --azblob-backup-container-name string Azure Blob Container Name. + --azblob-backup-parallelism int Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob-backup-buffer-size). (default 1) + --azblob-backup-storage-root string Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/'). + --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 true) + --backup-storage-implementation string Which backup storage implementation to use for creating and restoring backups. + --backup-storage-number-blocks int if backup-storage-compress is true, backup-storage-number-blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) --bind-address string Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system. --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. - --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) + --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) --ceph_backup_storage_config string Path to JSON config file for ceph backup storage. (default "ceph_backup_config.json") --compression-engine-name string compressor engine used for compression. (default "pargzip") --compression-level int what level to pass to the compressor. (default 1) @@ -77,7 +77,7 @@ Flags: --config-path strings Paths to search for config files in. (default [{{ .Workdir }}]) --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s) --config-type string Config file type (omit to infer config type from file extension). - --consul_auth_static_file string JSON File to read the topos/tokens from. + --consul-auth-static-file string JSON File to read the topos/tokens from. --db-allprivs-password string db allprivs password --db-allprivs-use-ssl Set this flag to false to make the allprivs connection to not use ssl (default true) --db-allprivs-user string db allprivs user userKey (default "vt_allprivs") @@ -127,13 +127,13 @@ 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. --detach detached mode - run backups detached from the terminal --disable-redo-log Disable InnoDB redo log during replication-from-primary phase of backup. - --emit_stats If set, emit stats to push-based monitoring and stats backends + --emit-stats If set, emit stats to push-based monitoring and stats backends --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. --file_backup_storage_root string Root directory for the file backup storage. - --gcs_backup_storage_bucket string Google Cloud Storage bucket to use for backups. - --gcs_backup_storage_root string Root prefix for all backup-related object names. + --gcs-backup-storage-bucket string Google Cloud Storage bucket to use for backups. + --gcs-backup-storage-root string Root prefix for all backup-related object names. --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-dial-concurrency-limit int Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000. (default 1024) @@ -146,10 +146,10 @@ Flags: --grpc-prometheus Enable gRPC monitoring with Prometheus. -h, --help help for vtbackup --incremental_from_pos string Position, or name of backup from which to create an incremental backup. Default: empty. If given, then this backup becomes an incremental backup from given position or given backup. If value is 'auto', this backup will be taken from the last successful backup position. - --init_db_name_override string (init parameter) override the name of the db used by vttablet + --init-db-name-override string (init parameter) override the name of the db used by vttablet + --init-keyspace string (init parameter) keyspace to use for this tablet + --init-shard string (init parameter) shard to use for this tablet --init_db_sql_file string path to .sql file to run after mysql_install_db - --init_keyspace string (init parameter) keyspace to use for this tablet - --init_shard string (init parameter) shard to use for this tablet --initial_backup Instead of restoring from backup, initialize an empty database with the provided init_db_sql_file and upload a backup of that for the shard, if the shard has no backups yet. This can be used to seed a brand new shard with an initial, empty backup. If any backups already exist for the shard, this will be considered a successful no-op. This can only be done before the shard exists in topology (i.e. before any tablets are deployed). --keep-alive-timeout duration Wait until timeout elapses after a successful backup before shutting down. --keep-logs duration keep logs for this long (using ctime) (zero to keep forever) @@ -164,24 +164,25 @@ Flags: --min_backup_interval duration Only take a new backup if it's been at least this long since the most recent backup. --min_retention_count int Always keep at least this many of the most recent backups in this backup storage location, even if some are older than the min_retention_time. This must be at least 1 since a backup must always exist to allow new backups to be made (default 1) --min_retention_time duration Keep each old backup for at least this long before removing it. Set to 0 to disable pruning of old backups. + --mycnf-bin-log-path string mysql binlog path + --mycnf-data-dir string data directory for mysql + --mycnf-error-log-path string mysql error log path --mycnf-file string path to my.cnf, if reading all config params from there - --mycnf_bin_log_path string mysql binlog path - --mycnf_data_dir string data directory for mysql - --mycnf_error_log_path string mysql error log path - --mycnf_general_log_path string mysql general log path - --mycnf_innodb_data_home_dir string Innodb data home directory - --mycnf_innodb_log_group_home_dir string Innodb log group home directory - --mycnf_master_info_file string mysql master.info file - --mycnf_mysql_port int port mysql is listening on - --mycnf_pid_file string mysql pid file - --mycnf_relay_log_index_path string mysql relay log index path - --mycnf_relay_log_info_path string mysql relay log info path - --mycnf_relay_log_path string mysql relay log path - --mycnf_secure_file_priv string mysql path for loading secure files - --mycnf_server_id int mysql server id of the server (if specified, mycnf-file will be ignored) - --mycnf_slow_log_path string mysql slow query log path - --mycnf_socket_file string mysql socket file - --mycnf_tmp_dir string mysql tmp directory + --mycnf-general-log-path string mysql general log path + --mycnf-innodb-data-home-dir string Innodb data home directory + --mycnf-innodb-log-group-home-dir string Innodb log group home directory + --mycnf-master-info-file string mysql master.info file + --mycnf-mysql-port int port mysql is listening on + --mycnf-pid-file string mysql pid file + --mycnf-relay-log-index-path string mysql relay log index path + --mycnf-relay-log-info-path string mysql relay log info path + --mycnf-relay-log-path string mysql relay log path + --mycnf-secure-file-priv string mysql path for loading secure files + --mycnf-server-id int mysql server id of the server (if specified, mycnf-file will be ignored) + --mycnf-slow-log-path string mysql slow query log path + --mycnf-socket-file string mysql socket file + --mycnf-tmp-dir string mysql tmp directory + --mysql-port int MySQL port (default 3306) --mysql-server-version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql-shell-backup-location string location where the backup will be stored --mysql-shell-dump-flags string flags to pass to mysql shell dump utility. This should be a JSON string and will be saved in the MANIFEST (default "{\"threads\": 4}") @@ -190,26 +191,25 @@ Flags: --mysql-shell-should-drain decide if we should drain while taking a backup or continue to serving traffic --mysql-shell-speedup-restore speed up restore by disabling redo logging and double write buffer during the restore process --mysql-shutdown-timeout duration how long to wait for mysqld shutdown (default 5m0s) - --mysql_port int mysql port (default 3306) - --mysql_socket string path to the mysql socket + --mysql-socket string Path to the mysqld socket file --mysql_timeout duration how long to wait for mysqld startup (default 5m0s) --opentsdb_uri string URI of opentsdb /api/put method --port int port for the server --pprof strings enable profiling --pprof-http enable pprof http endpoints --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 15s) + --remote-operation-timeout duration time to wait for a remote operation (default 15s) --restart_before_backup Perform a mysqld clean/full restart after applying binlogs, but before taking the backup. Only makes sense to work around xtrabackup bugs. - --s3_backup_aws_endpoint string endpoint of the S3 backend (region must be provided). - --s3_backup_aws_min_partsize int Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size. (default 5242880) - --s3_backup_aws_region string AWS region to use. (default "us-east-1") - --s3_backup_aws_retries int AWS request retries. (default -1) - --s3_backup_force_path_style force the s3 path style. - --s3_backup_log_level string determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. (default "LogOff") - --s3_backup_server_side_encryption string server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file). - --s3_backup_storage_bucket string S3 bucket to use for backups. - --s3_backup_storage_root string root prefix for all backup-related object names. - --s3_backup_tls_skip_verify_cert skip the 'certificate is valid' check for SSL connections. + --s3-backup-aws-endpoint string endpoint of the S3 backend (region must be provided). + --s3-backup-aws-min-partsize int Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size. (default 5242880) + --s3-backup-aws-region string AWS region to use. (default "us-east-1") + --s3-backup-aws-retries int AWS request retries. (default -1) + --s3-backup-force-path-style force the s3 path style. + --s3-backup-log-level string determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. (default "LogOff") + --s3-backup-server-side-encryption string server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file). + --s3-backup-storage-bucket string S3 bucket to use for backups. + --s3-backup-storage-root string root prefix for all backup-related object names. + --s3-backup-tls-skip-verify-cert skip the 'certificate is valid' check for SSL connections. --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) --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) @@ -250,10 +250,10 @@ Flags: -v, --version print binary version --vmodule vModuleFlag 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. 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. + --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/vtbench.txt b/go/flags/endtoend/vtbench.txt index bdc97eed173..f7e3653e062 100644 --- a/go/flags/endtoend/vtbench.txt +++ b/go/flags/endtoend/vtbench.txt @@ -81,11 +81,11 @@ Flags: --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 severityFlag logs at or above this threshold go to stderr (default 1) - --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 - --tablet_grpc_key string the key to use to connect - --tablet_grpc_server_name string the server name to use to validate server certificate + --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 + --tablet-grpc-key string the key to use to connect + --tablet-grpc-server-name string the server name to use to validate server certificate --threads int Number of parallel threads to run (default 2) --unix_socket string VTGate unix socket --user string Username to connect using mysql (password comes from the db-credentials-file) diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index 781ce71db08..f611333e425 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -16,10 +16,10 @@ 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 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, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) + --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 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, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) --bind-address string Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system. --binlog-in-memory-decompressor-max-size uint This value sets the uncompressed transaction payload size at which we switch from in-memory buffer based decompression to the slower streaming mode. (default 134217728) --binlog_player_protocol string the protocol to download binlogs from a vttablet (default "grpc") @@ -32,8 +32,8 @@ Flags: --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. - --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) + --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 --cell string cell to use --compression-engine-name string compressor engine used for compression. (default "pargzip") @@ -47,7 +47,7 @@ Flags: --consolidator-query-waiter-cap int Configure the maximum number of clients allowed to wait on the consolidator. --consolidator-stream-query-size int Configure the stream consolidator query size in bytes. Setting to 0 disables the stream consolidator. (default 2097152) --consolidator-stream-total-size int Configure the stream consolidator total size in bytes. Setting to 0 disables the stream consolidator. (default 134217728) - --consul_auth_static_file string JSON File to read the topos/tokens from. + --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 --db-allprivs-password string db allprivs password @@ -106,7 +106,7 @@ Flags: --disk-write-dir string if provided, tablet will attempt to write a file to this directory to check if the disk is stalled --disk-write-interval duration how often to write to the disk to check whether it is stalled (default 5s) --disk-write-timeout duration if writes exceed this duration, the disk is considered stalled (default 30s) - --emit_stats If set, emit stats to push-based monitoring and stats backends + --emit-stats If set, emit stats to push-based monitoring and stats backends --enable-consolidator Synonym to -enable_consolidator (default true) --enable-consolidator-replicas Synonym to -enable_consolidator_replicas --enable-partial-keyspace-migration (Experimental) Follow shard routing rules: enable only while migrating a keyspace shard by shard. See documentation on Partial MoveTables for more. (default false) @@ -164,18 +164,18 @@ Flags: --health_check_interval duration Interval between health checks (default 20s) --healthcheck_retry_delay duration health check retry delay (default 2ms) --healthcheck_timeout duration the health check timeout period (default 1m0s) - --heartbeat_enable If true, vttablet records (if master) or checks (if replica) the current time of a replication heartbeat in the sidecar database's heartbeat table. The result is used to inform the serving state of the vttablet via healthchecks. - --heartbeat_interval duration How frequently to read and write replication heartbeat. (default 1s) + --heartbeat-enable If true, vttablet records (if master) or checks (if replica) the current time of a replication heartbeat in the sidecar database's heartbeat table. The result is used to inform the serving state of the vttablet via healthchecks. + --heartbeat-interval duration How frequently to read and write replication heartbeat. (default 1s) --heartbeat_on_demand_duration duration If non-zero, heartbeats are only written upon consumer request, and only run for up to given duration following the request. Frequent requests can keep the heartbeat running consistently; when requests are infrequent heartbeat may completely stop between requests -h, --help help for vtcombo --hot_row_protection_concurrent_transactions int Number of concurrent transactions let through to the txpool/MySQL for the same hot row. Should be > 1 to have enough 'ready' transactions in MySQL and benefit from a pipelining effect. (default 5) --hot_row_protection_max_global_queue_size int Global queue limit across all row (ranges). Useful to prevent that the queue can grow unbounded. (default 1000) --hot_row_protection_max_queue_size int Maximum number of BeginExecute RPCs which will be queued for the same row (range). (default 20) - --init_db_name_override string (init parameter) override the name of the db used by vttablet. Without this flag, the db name defaults to vt_ - --init_keyspace string (init parameter) keyspace to use for this tablet - --init_shard string (init parameter) shard to use for this tablet - --init_tablet_type string (init parameter) the tablet type to use for this tablet. - --init_tags StringMap (init parameter) comma separated list of key:value pairs used to tag the tablet + --init-db-name-override string (init parameter) override the name of the db used by vttablet. Without this flag, the db name defaults to vt_ + --init-keyspace string (init parameter) keyspace to use for this tablet + --init-shard string (init parameter) shard to use for this tablet + --init-tablet-type string (init parameter) tablet type to use for this tablet. Valid values are: PRIMARY, REPLICA, SPARE, and RDONLY. The default is REPLICA. + --init-tags StringMap (init parameter) comma separated list of key:value pairs used to tag the tablet --init_timeout duration (init parameter) timeout to use for the init phase. (default 1m0s) --jaeger-agent-host string host and port to send spans to. if empty, no tracing will be done --json_topo vttest.TopoData vttest proto definition of the topology, encoded in json format. See vttest.proto for more information. @@ -199,27 +199,30 @@ Flags: --max_payload_size int The threshold for query payloads in bytes. A payload greater than this threshold will result in a failure to handle the query. --message_stream_grace_period duration the amount of time to give for a vttablet to resume if it ends a message stream, usually because of a reparent. (default 30s) --migration_check_interval duration Interval between migration checks (default 1m0s) + --mycnf-bin-log-path string mysql binlog path + --mycnf-data-dir string data directory for mysql + --mycnf-error-log-path string mysql error log path --mycnf-file string path to my.cnf, if reading all config params from there - --mycnf_bin_log_path string mysql binlog path - --mycnf_data_dir string data directory for mysql - --mycnf_error_log_path string mysql error log path - --mycnf_general_log_path string mysql general log path - --mycnf_innodb_data_home_dir string Innodb data home directory - --mycnf_innodb_log_group_home_dir string Innodb log group home directory - --mycnf_master_info_file string mysql master.info file - --mycnf_mysql_port int port mysql is listening on - --mycnf_pid_file string mysql pid file - --mycnf_relay_log_index_path string mysql relay log index path - --mycnf_relay_log_info_path string mysql relay log info path - --mycnf_relay_log_path string mysql relay log path - --mycnf_secure_file_priv string mysql path for loading secure files - --mycnf_server_id int mysql server id of the server (if specified, mycnf-file will be ignored) - --mycnf_slow_log_path string mysql slow query log path - --mycnf_socket_file string mysql socket file - --mycnf_tmp_dir string mysql tmp directory + --mycnf-general-log-path string mysql general log path + --mycnf-innodb-data-home-dir string Innodb data home directory + --mycnf-innodb-log-group-home-dir string Innodb log group home directory + --mycnf-master-info-file string mysql master.info file + --mycnf-mysql-port int port mysql is listening on + --mycnf-pid-file string mysql pid file + --mycnf-relay-log-index-path string mysql relay log index path + --mycnf-relay-log-info-path string mysql relay log info path + --mycnf-relay-log-path string mysql relay log path + --mycnf-secure-file-priv string mysql path for loading secure files + --mycnf-server-id int mysql server id of the server (if specified, mycnf-file will be ignored) + --mycnf-slow-log-path string mysql slow query log path + --mycnf-socket-file string mysql socket file + --mycnf-tmp-dir string mysql tmp directory + --mysql-auth-server-impl string Which auth server implementation to use. Options: none, ldap, clientcert, static, vault. (default "static") + --mysql-port int mysql port (default 3306) --mysql-server-drain-onterm If set, the server waits for --onterm-timeout for already connected clients to complete their in flight work --mysql-server-keepalive-period duration TCP period between keep-alives --mysql-server-pool-conn-read-buffers If set, the server will pool incoming connection read buffers + --mysql-server-port int If set, also listen for MySQL binary protocol connections on this port. (default -1) --mysql-server-version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql-shell-backup-location string location where the backup will be stored --mysql-shell-dump-flags string flags to pass to mysql shell dump utility. This should be a JSON string and will be saved in the MANIFEST (default "{\"threads\": 4}") @@ -229,12 +232,9 @@ Flags: --mysql-shell-speedup-restore speed up restore by disabling redo logging and double write buffer during the restore process --mysql-shutdown-timeout duration timeout to use when MySQL is being shut down. (default 5m0s) --mysql_allow_clear_text_without_tls If set, the server will allow the use of a clear text password over non-SSL connections. - --mysql_auth_server_impl string Which auth server implementation to use. Options: none, ldap, clientcert, static, vault. (default "static") --mysql_default_workload string Default session workload (OLTP, OLAP, DBA) (default "OLTP") - --mysql_port int mysql port (default 3306) --mysql_server_bind_address string Binds on this address when listening to MySQL binary protocol. Useful to restrict listening to 'localhost' only for instance. --mysql_server_flush_delay duration Delay after which buffered response will be flushed to the client. (default 100ms) - --mysql_server_port int If set, also listen for MySQL binary protocol connections on this port. (default -1) --mysql_server_query_timeout duration mysql query timeout --mysql_server_read_timeout duration connection read timeout --mysql_server_require_secure_transport Reject insecure connections but only if mysql_server_ssl_cert and mysql_server_ssl_key are provided @@ -256,7 +256,7 @@ Flags: --onterm-timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) --pid-file string If set, the process will write its pid to the named file, and delete it on graceful shutdown. --planner-version string Sets the default planner to use when the session has not changed it. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right - --pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled) + --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 --pprof-http enable pprof http endpoints @@ -306,8 +306,8 @@ Flags: --redact-debug-ui-queries redact full queries and bind variables from debug UI --relay_log_max_items int Maximum number of rows for vreplication target buffering. (default 5000) --relay_log_max_size int Maximum buffer size (in bytes) for vreplication target buffering. If single rows are larger than this, a single row is buffered at a time. (default 250000) - --remote_operation_timeout duration time to wait for a remote operation (default 15s) - --replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) + --remote-operation-timeout duration time to wait for a remote operation (default 15s) + --replication-connect-retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) --restore-from-backup-allowed-engines strings (init restore parameter) if set, only backups taken with the specified engines are eligible to be restored --restore-to-pos string (init incremental restore parameter) if set, run a point in time recovery that ends with the given position. This will attempt to use one full backup followed by zero or more incremental backups --restore-to-timestamp string (init incremental restore parameter) if set, run a point in time recovery that restores up to the given timestamp, if possible. Given timestamp in RFC3339 format. Example: '2006-01-02T15:04:05Z07:00' @@ -328,9 +328,9 @@ Flags: --shutdown_grace_period duration how long to wait for queries and transactions to complete during graceful shutdown. (default 3s) --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) - --srv_topo_cache_refresh duration how frequently to refresh the topology for cached entries (default 1s) - --srv_topo_cache_ttl duration how long to use cached entries for topology (default 1s) - --srv_topo_timeout duration topo server timeout (default 5s) + --srv-topo-cache-refresh duration how frequently to refresh the topology for cached entries (default 1s) + --srv-topo-cache-ttl duration how long to use cached entries for topology (default 1s) + --srv-topo-timeout duration topo server timeout (default 5s) --start_mysql Should vtcombo also start mysql --stats-backend string The name of the registered push-based monitoring/stats backend to use --stats-combine-dimensions string List of dimensions to be combined into a single "all" value in exported stats vars @@ -344,6 +344,7 @@ Flags: --table_gc_lifecycle string States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implicitly always included) (default "hold,purge,evac,drop") --tablet-dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. --tablet-filter-tags StringMap Specifies a comma-separated list of tablet tags (as key:value pairs) to filter the tablets to watch. + --tablet-hostname string if not empty, this hostname will be assumed instead of trying to resolve it --tablet-manager-grpc-ca string the server ca to use to validate servers when connecting --tablet-manager-grpc-cert string the cert to use to connect --tablet-manager-grpc-concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8) @@ -352,13 +353,12 @@ Flags: --tablet-manager-grpc-key string the key to use to connect --tablet-manager-grpc-server-name string the server name to use to validate server certificate --tablet-manager-protocol string Protocol to use to make tabletmanager 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 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}}" }}") --tablet_filters strings Specifies a comma-separated list of 'keyspace|shard_name or keyrange' values to filter the tablets to watch. --tablet_health_keep_alive duration close streaming tablet health connection if there are no requests for this long (default 5m0s) - --tablet_hostname string if not empty, this hostname will be assumed instead of trying to resolve it - --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 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}}" }}") --throttle_tablet_types string Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' always implicitly included (default "replica") --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") @@ -431,7 +431,7 @@ Flags: --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 - --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 "/.*/") + --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 --warming-reads-concurrency int Number of concurrent warming reads allowed (default 500) --warming-reads-percent int Percentage of reads on the primary to forward to replicas. Useful for keeping buffer pools warm @@ -441,10 +441,10 @@ Flags: --warn_sharded_only If any features that are only available in unsharded mode are used, query execution warnings will be added to the session --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. 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. + --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 337785777e2..f29c740fd0c 100644 --- a/go/flags/endtoend/vtctld.txt +++ b/go/flags/endtoend/vtctld.txt @@ -15,7 +15,7 @@ vtctld \ --topo-global-server-address localhost:2379 \ --topo-global-root /vitess/ \ --service-map 'grpc-vtctl,grpc-vtctld' \ - --backup_storage_implementation file \ + --backup-storage-implementation file \ --file_backup_storage_root $VTDATAROOT/backups \ --port 15000 \ --grpc-port 15999 @@ -23,23 +23,23 @@ vtctld \ Flags: --action_timeout duration time to wait for an action before resorting to force (default 1m0s) --alsologtostderr log to standard error as well as files - --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_buffer_size int The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service. (default 104857600) - --azblob_backup_container_name string Azure Blob Container Name. - --azblob_backup_parallelism int Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob_backup_buffer_size). (default 1) - --azblob_backup_storage_root string Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/'). - --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 true) - --backup_storage_implementation string Which backup storage implementation to use for creating and restoring backups. - --backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) + --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-buffer-size int The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service. (default 104857600) + --azblob-backup-container-name string Azure Blob Container Name. + --azblob-backup-parallelism int Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob-backup-buffer-size). (default 1) + --azblob-backup-storage-root string Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/'). + --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 true) + --backup-storage-implementation string Which backup storage implementation to use for creating and restoring backups. + --backup-storage-number-blocks int if backup-storage-compress is true, backup-storage-number-blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) --bind-address string Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system. --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. - --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) + --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 --cell string cell to use --ceph_backup_storage_config string Path to JSON config file for ceph backup storage. (default "ceph_backup_config.json") @@ -49,14 +49,14 @@ Flags: --config-path strings Paths to search for config files in. (default [{{ .Workdir }}]) --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s) --config-type string Config file type (omit to infer config type from file extension). - --consul_auth_static_file string JSON File to read the topos/tokens from. + --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 --disable_active_reparents if set, do not allow active reparents. Use this to protect a cluster using external reparents. - --emit_stats If set, emit stats to push-based monitoring and stats backends + --emit-stats If set, emit stats to push-based monitoring and stats backends --file_backup_storage_root string Root directory for the file backup storage. - --gcs_backup_storage_bucket string Google Cloud Storage bucket to use for backups. - --gcs_backup_storage_root string Root prefix for all backup-related object names. + --gcs-backup-storage-bucket string Google Cloud Storage bucket to use for backups. + --gcs-backup-storage-root string Root prefix for all backup-related object names. --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. @@ -108,17 +108,17 @@ Flags: --pprof-http enable pprof http endpoints --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 15s) - --s3_backup_aws_endpoint string endpoint of the S3 backend (region must be provided). - --s3_backup_aws_min_partsize int Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size. (default 5242880) - --s3_backup_aws_region string AWS region to use. (default "us-east-1") - --s3_backup_aws_retries int AWS request retries. (default -1) - --s3_backup_force_path_style force the s3 path style. - --s3_backup_log_level string determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. (default "LogOff") - --s3_backup_server_side_encryption string server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file). - --s3_backup_storage_bucket string S3 bucket to use for backups. - --s3_backup_storage_root string root prefix for all backup-related object names. - --s3_backup_tls_skip_verify_cert skip the 'certificate is valid' check for SSL connections. + --remote-operation-timeout duration time to wait for a remote operation (default 15s) + --s3-backup-aws-endpoint string endpoint of the S3 backend (region must be provided). + --s3-backup-aws-min-partsize int Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size. (default 5242880) + --s3-backup-aws-region string AWS region to use. (default "us-east-1") + --s3-backup-aws-retries int AWS request retries. (default -1) + --s3-backup-force-path-style force the s3 path style. + --s3-backup-log-level string determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. (default "LogOff") + --s3-backup-server-side-encryption string server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file). + --s3-backup-storage-bucket string S3 bucket to use for backups. + --s3-backup-storage-root string root prefix for all backup-related object names. + --s3-backup-tls-skip-verify-cert skip the 'certificate is valid' check for SSL connections. --schema_change_check_interval duration How often the schema change dir is checked for schema changes. This value must be positive; if zero or lower, the default of 1m is used. (default 1m0s) --schema_change_controller string Schema change controller is responsible for finding schema changes and responding to schema change events. --schema_change_dir string Directory containing schema changes for all keyspaces. Each keyspace has its own directory, and schema changes are expected to live in '$KEYSPACE/input' dir. (e.g. 'test_keyspace/input/*sql'). Each sql file represents a schema change. @@ -136,6 +136,11 @@ Flags: --stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1) --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class --tablet-dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. + --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 + --tablet-grpc-key string the key to use to connect + --tablet-grpc-server-name string the server name to use to validate server certificate --tablet-manager-grpc-ca string the server ca to use to validate servers when connecting --tablet-manager-grpc-cert string the cert to use to connect --tablet-manager-grpc-concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8) @@ -144,16 +149,11 @@ Flags: --tablet-manager-grpc-key string the key to use to connect --tablet-manager-grpc-server-name string the server name to use to validate server certificate --tablet-manager-protocol string Protocol to use to make tabletmanager RPCs to vttablets. (default "grpc") - --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 - --tablet_grpc_key string the key to use to connect - --tablet_grpc_server_name string the server name to use to validate server certificate + --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-url-template string Format string describing debug tablet url formatting. See getTabletDebugURL() for how to customize this. (default "http://{{ "{{.GetTabletHostPort}}" }}") --tablet_health_keep_alive duration close streaming tablet health connection if there are no requests for this long (default 5m0s) - --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_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") --topo-consul-lock-session-ttl string TTL for consul session. diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt index 59df3f03451..b489004cd35 100644 --- a/go/flags/endtoend/vtgate.txt +++ b/go/flags/endtoend/vtgate.txt @@ -2,7 +2,7 @@ VTGate is a stateless proxy responsible for accepting requests from applications ### Key Options -* `--srv_topo_cache_ttl`: There may be instances where you will need to increase the cached TTL from the default of 1 second to a higher number: +* `--srv-topo-cache-ttl`: There may be instances where you will need to increase the cached TTL from the default of 1 second to a higher number: * You may want to increase this option if you see that your topo leader goes down and keeps your queries waiting for a few seconds. Usage: @@ -16,13 +16,13 @@ vtgate \ --log_dir $VTDATAROOT/tmp \ --port 15001 \ --grpc-port 15991 \ - --mysql_server_port 15306 \ + --mysql-server-port 15306 \ --cell test \ --cells_to_watch test \ - --tablet_types_to_wait PRIMARY,REPLICA \ + --tablet-types-to-wait PRIMARY,REPLICA \ --service-map 'grpc-vtgateservice' \ --pid-file $VTDATAROOT/tmp/vtgate.pid \ - --mysql_auth_server_impl none + --mysql-auth-server-impl none Flags: --allow-kill-statement Allows the execution of kill statement @@ -46,7 +46,7 @@ Flags: --config-path strings Paths to search for config files in. (default [{{ .Workdir }}]) --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s) --config-type string Config file type (omit to infer config type from file extension). - --consul_auth_static_file string JSON File to read the topos/tokens from. + --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 --dbddl_plugin string controls how to handle CREATE/DROP DATABASE. use it if you are using your own database provisioning service (default "fail") @@ -54,7 +54,7 @@ Flags: --default_tablet_type topodatapb.TabletType The default tablet type to set for queries, when one is not explicitly selected. (default PRIMARY) --discovery_high_replication_lag_minimum_serving duration Threshold above which replication lag is considered too high when applying the min_number_serving_vttablets flag. (default 2h0m0s) --discovery_low_replication_lag duration Threshold below which replication lag is considered low enough to be healthy. (default 30s) - --emit_stats If set, emit stats to push-based monitoring and stats backends + --emit-stats If set, emit stats to push-based monitoring and stats backends --enable-balancer Enable the tablet balancer to evenly spread query load for a given tablet type --enable-partial-keyspace-migration (Experimental) Follow shard routing rules: enable only while migrating a keyspace shard by shard. See documentation on Partial MoveTables for more. (default false) --enable-views Enable views support in vtgate. (default true) @@ -121,12 +121,13 @@ Flags: --max_payload_size int The threshold for query payloads in bytes. A payload greater than this threshold will result in a failure to handle the query. --message_stream_grace_period duration the amount of time to give for a vttablet to resume if it ends a message stream, usually because of a reparent. (default 30s) --min_number_serving_vttablets int The minimum number of vttablets for each replicating tablet_type (e.g. replica, rdonly) that will be continue to be used even with replication lag above discovery_low_replication_lag, but still below discovery_high_replication_lag_minimum_serving. (default 2) + --mysql-auth-server-impl string Which auth server implementation to use. Options: none, ldap, clientcert, static, vault. (default "static") --mysql-server-drain-onterm If set, the server waits for --onterm-timeout for already connected clients to complete their in flight work --mysql-server-keepalive-period duration TCP period between keep-alives --mysql-server-pool-conn-read-buffers If set, the server will pool incoming connection read buffers + --mysql-server-port int If set, also listen for MySQL binary protocol connections on this port. (default -1) --mysql-server-version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql_allow_clear_text_without_tls If set, the server will allow the use of a clear text password over non-SSL connections. - --mysql_auth_server_impl string Which auth server implementation to use. Options: none, ldap, clientcert, static, vault. (default "static") --mysql_auth_server_static_file string JSON File to read the users/passwords from. --mysql_auth_server_static_string string JSON representation of the users/passwords config. --mysql_auth_static_reload_interval duration Ticker to reload credentials @@ -146,7 +147,6 @@ Flags: --mysql_ldap_auth_method string client-side authentication method to use. Supported values: mysql_clear_password, dialog. (default "mysql_clear_password") --mysql_server_bind_address string Binds on this address when listening to MySQL binary protocol. Useful to restrict listening to 'localhost' only for instance. --mysql_server_flush_delay duration Delay after which buffered response will be flushed to the client. (default 100ms) - --mysql_server_port int If set, also listen for MySQL binary protocol connections on this port. (default -1) --mysql_server_query_timeout duration mysql query timeout --mysql_server_read_timeout duration connection read timeout --mysql_server_require_secure_transport Reject insecure connections but only if mysql_server_ssl_cert and mysql_server_ssl_key are provided @@ -180,16 +180,16 @@ Flags: --querylog-row-threshold uint Number of rows a query has to return or affect before being logged; not useful for streaming queries. 0 means all queries will be logged. --querylog-sample-rate float Sample rate for logging queries. Value must be between 0.0 (no logging) and 1.0 (all queries) --redact-debug-ui-queries redact full queries and bind variables from debug UI - --remote_operation_timeout duration time to wait for a remote operation (default 15s) + --remote-operation-timeout duration time to wait for a remote operation (default 15s) --retry-count int retry count (default 2) --schema_change_signal Enable the schema tracker; requires queryserver-config-schema-change-signal to be enabled on the underlying vttablets for this to work (default true) --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) --service-map strings comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice --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) - --srv_topo_cache_refresh duration how frequently to refresh the topology for cached entries (default 1s) - --srv_topo_cache_ttl duration how long to use cached entries for topology (default 1s) - --srv_topo_timeout duration topo server timeout (default 5s) + --srv-topo-cache-refresh duration how frequently to refresh the topology for cached entries (default 1s) + --srv-topo-cache-ttl duration how long to use cached entries for topology (default 1s) + --srv-topo-timeout duration topo server timeout (default 5s) --stats-backend string The name of the registered push-based monitoring/stats backend to use --stats-combine-dimensions string List of dimensions to be combined into a single "all" value in exported stats vars --stats-common-tags strings Comma-separated list of common tags for the stats backend. It provides both label and values. Example: label1:value1,label2:value2 @@ -201,17 +201,17 @@ Flags: --stream_buffer_size int the number of bytes sent from vtgate for each stream call. It's recommended to keep this value in sync with vttablet's query-server-config-stream-buffer-size. (default 32768) --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class --tablet-filter-tags StringMap Specifies a comma-separated list of tablet tags (as key:value pairs) 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 + --tablet-grpc-key string the key to use to connect + --tablet-grpc-server-name string the server name to use to validate server certificate + --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 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}}" }}") --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 - --tablet_grpc_key string the key to use to connect - --tablet_grpc_server_name string the server name to use to validate server certificate - --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 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") --topo-consul-lock-session-ttl string TTL for consul session. diff --git a/go/flags/endtoend/vtorc.txt b/go/flags/endtoend/vtorc.txt index 8e1cad885bb..749dbfa6ea1 100644 --- a/go/flags/endtoend/vtorc.txt +++ b/go/flags/endtoend/vtorc.txt @@ -33,9 +33,9 @@ Flags: --config-path strings Paths to search for config files in. (default [{{ .Workdir }}]) --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s) --config-type string Config file type (omit to infer config type from file extension). - --consul_auth_static_file string JSON File to read the topos/tokens from. + --consul-auth-static-file string JSON File to read the topos/tokens from. --discovery-workers int Number of workers used for tablet discovery (default 300) - --emit_stats If set, emit stats to push-based monitoring and stats backends + --emit-stats If set, emit stats to push-based monitoring and stats backends --enable-primary-disk-stalled-recovery Whether VTOrc should detect a stalled disk on the primary and failover --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 @@ -69,7 +69,7 @@ Flags: --purge-logs-interval duration how often try to remove old logs (default 1h0m0s) --reasonable-replication-lag duration Maximum replication lag on replicas which is deemed to be acceptable (default 10s) --recovery-poll-duration duration Timer duration on which VTOrc polls its database to run a recovery (default 1s) - --remote_operation_timeout duration time to wait for a remote operation (default 15s) + --remote-operation-timeout duration time to wait for a remote operation (default 15s) --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) --shutdown_wait_time duration Maximum time to wait for VTOrc to release all the locks that it is holding before shutting down on SIGTERM (default 30s) --snapshot-topology-interval duration Timer duration on which VTOrc takes a snapshot of the current MySQL information it has in the database. Should be in multiple of hours diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index 3fa98e68f4e..b333c91c634 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -18,8 +18,8 @@ See "Unmanaged Tablet" for the full guide. Even if a MySQL is external, you can still make vttablet perform some management functions. They are as follows: * `--unmanaged`: This flag indicates that this tablet is running in unmanaged mode. In this mode, any reparent or replica commands are not allowed. These are InitShardPrimary, PlannedReparentShard, EmergencyReparentShard, and ReparentTablet. You should use the TabletExternallyReparented command to inform vitess of the current primary. -* `--replication_connect_retry`: This value is give to mysql when it connects a replica to the primary as the retry duration parameter. -* `--heartbeat_enable` and `--heartbeat_interval duration`: cause vttablet to write heartbeats to the sidecar database. This information is also used by the replication reporter to assess replica lag. +* `--replication-connect-retry`: This value is give to mysql when it connects a replica to the primary as the retry duration parameter. +* `--heartbeat-enable` and `--heartbeat-interval duration`: cause vttablet to write heartbeats to the sidecar database. This information is also used by the replication reporter to assess replica lag. Usage: vttablet [flags] @@ -31,9 +31,9 @@ vttablet \ --topo-global-server-address localhost:2379 \ --topo-global-root /vitess/ \ --tablet-path $alias \ - --init_keyspace $keyspace \ - --init_shard $shard \ - --init_tablet_type $tablet_type \ + --init-keyspace $keyspace \ + --init-shard $shard \ + --init-tablet-type $tablet_type \ --port $port \ --grpc-port $grpc_port \ --service-map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream' @@ -44,17 +44,17 @@ 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) - --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_buffer_size int The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service. (default 104857600) - --azblob_backup_container_name string Azure Blob Container Name. - --azblob_backup_parallelism int Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob_backup_buffer_size). (default 1) - --azblob_backup_storage_root string Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/'). - --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 true) - --backup_storage_implementation string Which backup storage implementation to use for creating and restoring backups. - --backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) + --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-buffer-size int The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service. (default 104857600) + --azblob-backup-container-name string Azure Blob Container Name. + --azblob-backup-parallelism int Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob-backup-buffer-size). (default 1) + --azblob-backup-storage-root string Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/'). + --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 true) + --backup-storage-implementation string Which backup storage implementation to use for creating and restoring backups. + --backup-storage-number-blocks int if backup-storage-compress is true, backup-storage-number-blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) --bind-address string Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system. --binlog-in-memory-decompressor-max-size uint This value sets the uncompressed transaction payload size at which we switch from in-memory buffer based decompression to the slower streaming mode. (default 134217728) --binlog_player_grpc_ca string the server ca to use to validate servers when connecting @@ -66,8 +66,8 @@ Flags: --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. - --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) + --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 --ceph_backup_storage_config string Path to JSON config file for ceph backup storage. (default "ceph_backup_config.json") --compression-engine-name string compressor engine used for compression. (default "pargzip") @@ -81,7 +81,7 @@ Flags: --consolidator-query-waiter-cap int Configure the maximum number of clients allowed to wait on the consolidator. --consolidator-stream-query-size int Configure the stream consolidator query size in bytes. Setting to 0 disables the stream consolidator. (default 2097152) --consolidator-stream-total-size int Configure the stream consolidator total size in bytes. Setting to 0 disables the stream consolidator. (default 134217728) - --consul_auth_static_file string JSON File to read the topos/tokens from. + --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 --db-allprivs-password string db allprivs password @@ -137,7 +137,7 @@ Flags: --disk-write-dir string if provided, tablet will attempt to write a file to this directory to check if the disk is stalled --disk-write-interval duration how often to write to the disk to check whether it is stalled (default 5s) --disk-write-timeout duration if writes exceed this duration, the disk is considered stalled (default 30s) - --emit_stats If set, emit stats to push-based monitoring and stats backends + --emit-stats If set, emit stats to push-based monitoring and stats backends --enable-consolidator Synonym to -enable_consolidator (default true) --enable-consolidator-replicas Synonym to -enable_consolidator_replicas --enable-per-workload-table-metrics If true, query counts and query error metrics include a label that identifies the workload @@ -160,8 +160,8 @@ Flags: --filecustomrules_watch set up a watch on the target file and reload query rules when it changes --gc_check_interval duration Interval between garbage collection checks (default 1h0m0s) --gc_purge_check_interval duration Interval between purge discovery checks (default 1m0s) - --gcs_backup_storage_bucket string Google Cloud Storage bucket to use for backups. - --gcs_backup_storage_root string Root prefix for all backup-related object names. + --gcs-backup-storage-bucket string Google Cloud Storage bucket to use for backups. + --gcs-backup-storage-root string Root prefix for all backup-related object names. --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. @@ -192,18 +192,18 @@ Flags: --grpc-server-keepalive-time duration After a duration of this time, if the server doesn't see any activity, it pings the client to see if the transport is still alive. (default 10s) --grpc-server-keepalive-timeout duration After having pinged for keepalive check, the server waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) --health_check_interval duration Interval between health checks (default 20s) - --heartbeat_enable If true, vttablet records (if master) or checks (if replica) the current time of a replication heartbeat in the sidecar database's heartbeat table. The result is used to inform the serving state of the vttablet via healthchecks. - --heartbeat_interval duration How frequently to read and write replication heartbeat. (default 1s) + --heartbeat-enable If true, vttablet records (if master) or checks (if replica) the current time of a replication heartbeat in the sidecar database's heartbeat table. The result is used to inform the serving state of the vttablet via healthchecks. + --heartbeat-interval duration How frequently to read and write replication heartbeat. (default 1s) --heartbeat_on_demand_duration duration If non-zero, heartbeats are only written upon consumer request, and only run for up to given duration following the request. Frequent requests can keep the heartbeat running consistently; when requests are infrequent heartbeat may completely stop between requests -h, --help help for vttablet --hot_row_protection_concurrent_transactions int Number of concurrent transactions let through to the txpool/MySQL for the same hot row. Should be > 1 to have enough 'ready' transactions in MySQL and benefit from a pipelining effect. (default 5) --hot_row_protection_max_global_queue_size int Global queue limit across all row (ranges). Useful to prevent that the queue can grow unbounded. (default 1000) --hot_row_protection_max_queue_size int Maximum number of BeginExecute RPCs which will be queued for the same row (range). (default 20) - --init_db_name_override string (init parameter) override the name of the db used by vttablet. Without this flag, the db name defaults to vt_ - --init_keyspace string (init parameter) keyspace to use for this tablet - --init_shard string (init parameter) shard to use for this tablet - --init_tablet_type string (init parameter) the tablet type to use for this tablet. - --init_tags StringMap (init parameter) comma separated list of key:value pairs used to tag the tablet + --init-db-name-override string (init parameter) override the name of the db used by vttablet. Without this flag, the db name defaults to vt_ + --init-keyspace string (init parameter) keyspace to use for this tablet + --init-shard string (init parameter) shard to use for this tablet + --init-tablet-type string (init parameter) tablet type to use for this tablet. Valid values are: PRIMARY, REPLICA, SPARE, and RDONLY. The default is REPLICA. + --init-tags StringMap (init parameter) comma separated list of key:value pairs used to tag the tablet --init_timeout duration (init parameter) timeout to use for the init phase. (default 1m0s) --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) @@ -222,24 +222,24 @@ Flags: --max-stack-size int configure the maximum stack size in bytes (default 67108864) --max_concurrent_online_ddl int Maximum number of online DDL changes that may run concurrently (default 256) --migration_check_interval duration Interval between migration checks (default 1m0s) + --mycnf-bin-log-path string mysql binlog path + --mycnf-data-dir string data directory for mysql + --mycnf-error-log-path string mysql error log path --mycnf-file string path to my.cnf, if reading all config params from there - --mycnf_bin_log_path string mysql binlog path - --mycnf_data_dir string data directory for mysql - --mycnf_error_log_path string mysql error log path - --mycnf_general_log_path string mysql general log path - --mycnf_innodb_data_home_dir string Innodb data home directory - --mycnf_innodb_log_group_home_dir string Innodb log group home directory - --mycnf_master_info_file string mysql master.info file - --mycnf_mysql_port int port mysql is listening on - --mycnf_pid_file string mysql pid file - --mycnf_relay_log_index_path string mysql relay log index path - --mycnf_relay_log_info_path string mysql relay log info path - --mycnf_relay_log_path string mysql relay log path - --mycnf_secure_file_priv string mysql path for loading secure files - --mycnf_server_id int mysql server id of the server (if specified, mycnf-file will be ignored) - --mycnf_slow_log_path string mysql slow query log path - --mycnf_socket_file string mysql socket file - --mycnf_tmp_dir string mysql tmp directory + --mycnf-general-log-path string mysql general log path + --mycnf-innodb-data-home-dir string Innodb data home directory + --mycnf-innodb-log-group-home-dir string Innodb log group home directory + --mycnf-master-info-file string mysql master.info file + --mycnf-mysql-port int port mysql is listening on + --mycnf-pid-file string mysql pid file + --mycnf-relay-log-index-path string mysql relay log index path + --mycnf-relay-log-info-path string mysql relay log info path + --mycnf-relay-log-path string mysql relay log path + --mycnf-secure-file-priv string mysql path for loading secure files + --mycnf-server-id int mysql server id of the server (if specified, mycnf-file will be ignored) + --mycnf-slow-log-path string mysql slow query log path + --mycnf-socket-file string mysql socket file + --mycnf-tmp-dir string mysql tmp directory --mysql-server-version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql-shell-backup-location string location where the backup will be stored --mysql-shell-dump-flags string flags to pass to mysql shell dump utility. This should be a JSON string and will be saved in the MANIFEST (default "{\"threads\": 4}") @@ -254,7 +254,7 @@ Flags: --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) + --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 --pprof-http enable pprof http endpoints @@ -299,8 +299,8 @@ Flags: --redact-debug-ui-queries redact full queries and bind variables from debug UI --relay_log_max_items int Maximum number of rows for vreplication target buffering. (default 5000) --relay_log_max_size int Maximum buffer size (in bytes) for vreplication target buffering. If single rows are larger than this, a single row is buffered at a time. (default 250000) - --remote_operation_timeout duration time to wait for a remote operation (default 15s) - --replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) + --remote-operation-timeout duration time to wait for a remote operation (default 15s) + --replication-connect-retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) --restore-from-backup-allowed-engines strings (init restore parameter) if set, only backups taken with the specified engines are eligible to be restored --restore-to-pos string (init incremental restore parameter) if set, run a point in time recovery that ends with the given position. This will attempt to use one full backup followed by zero or more incremental backups --restore-to-timestamp string (init incremental restore parameter) if set, run a point in time recovery that restores up to the given timestamp, if possible. Given timestamp in RFC3339 format. Example: '2006-01-02T15:04:05Z07:00' @@ -308,16 +308,16 @@ Flags: --restore_from_backup (init restore parameter) will check BackupStorage for a recent backup at startup and start there --restore_from_backup_ts string (init restore parameter) if set, restore the latest backup taken at or before this timestamp. Example: '2021-04-29.133050' --retain_online_ddl_tables duration How long should vttablet keep an old migrated table before purging it (default 24h0m0s) - --s3_backup_aws_endpoint string endpoint of the S3 backend (region must be provided). - --s3_backup_aws_min_partsize int Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size. (default 5242880) - --s3_backup_aws_region string AWS region to use. (default "us-east-1") - --s3_backup_aws_retries int AWS request retries. (default -1) - --s3_backup_force_path_style force the s3 path style. - --s3_backup_log_level string determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. (default "LogOff") - --s3_backup_server_side_encryption string server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file). - --s3_backup_storage_bucket string S3 bucket to use for backups. - --s3_backup_storage_root string root prefix for all backup-related object names. - --s3_backup_tls_skip_verify_cert skip the 'certificate is valid' check for SSL connections. + --s3-backup-aws-endpoint string endpoint of the S3 backend (region must be provided). + --s3-backup-aws-min-partsize int Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size. (default 5242880) + --s3-backup-aws-region string AWS region to use. (default "us-east-1") + --s3-backup-aws-retries int AWS request retries. (default -1) + --s3-backup-force-path-style force the s3 path style. + --s3-backup-log-level string determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. (default "LogOff") + --s3-backup-server-side-encryption string server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file). + --s3-backup-storage-bucket string S3 bucket to use for backups. + --s3-backup-storage-root string root prefix for all backup-related object names. + --s3-backup-tls-skip-verify-cert skip the 'certificate is valid' check for SSL connections. --sanitize_log_messages Remove potentially sensitive information in tablet INFO, WARNING, and ERROR log messages such as query parameters. --schema-change-reload-timeout duration query server schema change reload timeout, this is how long to wait for the signaled schema reload operation to complete before giving up (default 30s) --schema-version-max-age-seconds int max age of schema version records to kept in memory by the vreplication historian @@ -329,9 +329,9 @@ Flags: --shutdown_grace_period duration how long to wait for queries and transactions to complete during graceful shutdown. (default 3s) --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) - --srv_topo_cache_refresh duration how frequently to refresh the topology for cached entries (default 1s) - --srv_topo_cache_ttl duration how long to use cached entries for topology (default 1s) - --srv_topo_timeout duration topo server timeout (default 5s) + --srv-topo-cache-refresh duration how frequently to refresh the topology for cached entries (default 1s) + --srv-topo-cache-ttl duration how long to use cached entries for topology (default 1s) + --srv-topo-timeout duration topo server timeout (default 5s) --stats-backend string The name of the registered push-based monitoring/stats backend to use --stats-combine-dimensions string List of dimensions to be combined into a single "all" value in exported stats vars --stats-common-tags strings Comma-separated list of common tags for the stats backend. It provides both label and values. Example: label1:value1,label2:value2 @@ -346,6 +346,12 @@ Flags: --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class --table_gc_lifecycle string States for a DROP TABLE garbage collection cycle. Default is 'hold,purge,evac,drop', use any subset ('drop' implicitly always included) (default "hold,purge,evac,drop") --tablet-dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. + --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 + --tablet-grpc-key string the key to use to connect + --tablet-grpc-server-name string the server name to use to validate server certificate + --tablet-hostname string if not empty, this hostname will be assumed instead of trying to resolve it --tablet-manager-grpc-ca string the server ca to use to validate servers when connecting --tablet-manager-grpc-cert string the cert to use to connect --tablet-manager-grpc-concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8) @@ -355,14 +361,8 @@ Flags: --tablet-manager-grpc-server-name string the server name to use to validate server certificate --tablet-manager-protocol string Protocol to use to make tabletmanager RPCs to vttablets. (default "grpc") --tablet-path string tablet alias + --tablet-protocol string Protocol to use to make queryservice RPCs to vttablets. (default "grpc") --tablet_config string YAML file config for tablet - --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 - --tablet_grpc_key string the key to use to connect - --tablet_grpc_server_name string the server name to use to validate server certificate - --tablet_hostname string if not empty, this hostname will be assumed instead of trying to resolve it - --tablet_protocol string Protocol to use to make queryservice RPCs to vttablets. (default "grpc") --throttle_tablet_types string Comma separated VTTablet types to be considered by the throttler. default: 'replica'. example: 'replica,rdonly'. 'replica' always implicitly included (default "replica") --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") @@ -425,14 +425,14 @@ Flags: --vstream-binlog-rotation-threshold int Byte size at which a VStreamer will attempt to rotate the source's open binary log before starting a GTID snapshot based stream (e.g. a ResultStreamer or RowStreamer) (default 67108864) --vstream-dynamic-packet-size Enable dynamic packet sizing for vstreamers. This will adjust the packet size in vreplication workflows to improve performance. (default true) --vstream-packet-size int Suggested packet size for vstreamers. The actual packet size may be more or less than this amount. (default 250000) - --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 "/.*/") + --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. 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. + --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/vttestserver.txt b/go/flags/endtoend/vttestserver.txt index 88821ea3f87..eeb48006e30 100644 --- a/go/flags/endtoend/vttestserver.txt +++ b/go/flags/endtoend/vttestserver.txt @@ -7,15 +7,15 @@ 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 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, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) + --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 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, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. - --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) + --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 --cells strings Comma separated list of cells (default [test]) --charset string MySQL charset (default "utf8mb4") @@ -27,7 +27,7 @@ Flags: --config-path strings Paths to search for config files in. (default [{{ .Workdir }}]) --config-persistence-min-interval duration minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s) --config-type string Config file type (omit to infer config type from file extension). - --consul_auth_static_file string JSON File to read the topos/tokens from. + --consul-auth-static-file string JSON File to read the topos/tokens from. --data_dir string Directory where the data files will be placed, defaults to a random directory under /vt/vtdataroot --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) @@ -73,8 +73,8 @@ Flags: --grpc-server-keepalive-time duration After a duration of this time, if the server doesn't see any activity, it pings the client to see if the transport is still alive. (default 10s) --grpc-server-keepalive-timeout duration After having pinged for keepalive check, the server waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) -h, --help help for vttestserver + --initialize-with-random-data If this flag is each table-shard will be initialized with random data. See also the 'rng_seed' and 'min_shard_size' and 'max_shard_size' flags. --initialize-with-vt-dba-tcp If this flag is enabled, MySQL will be initialized with an additional user named vt_dba_tcp, who will have access via TCP/IP connection. - --initialize_with_random_data If this flag is each table-shard will be initialized with random data. See also the 'rng_seed' and 'min_shard_size' and 'max_shard_size' flags. --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 strings Comma separated list of keyspaces (default [test_keyspace]) @@ -86,8 +86,8 @@ Flags: --logtostderr log to standard error instead of files --manifest-external-decompressor string command with arguments to store in the backup manifest when compressing a backup with an external compression engine. --max-stack-size int configure the maximum stack size in bytes (default 67108864) - --max_table_shard_size int The maximum number of initial rows in a table shard. Ignored if--initialize_with_random_data is false. The actual number is chosen randomly (default 10000) - --min_table_shard_size int The minimum number of initial rows in a table shard. Ignored if--initialize_with_random_data is false. The actual number is chosen randomly. (default 1000) + --max_table_shard_size int The maximum number of initial rows in a table shard. Ignored if--initialize-with-random-data is false. The actual number is chosen randomly (default 10000) + --min_table_shard_size int The minimum number of initial rows in a table shard. Ignored if--initialize-with-random-data is false. The actual number is chosen randomly. (default 1000) --mysql-server-version string MySQL server version to advertise. (default "8.0.40-Vitess") --mysql-shell-backup-location string location where the backup will be stored --mysql-shell-dump-flags string flags to pass to mysql shell dump utility. This should be a JSON string and will be saved in the MANIFEST (default "{\"threads\": 4}") @@ -100,14 +100,14 @@ Flags: --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) --no_scatter when set to true, the planner will fail instead of producing a plan that includes scatter queries - --null_probability float The probability to initialize a field with 'NULL' if --initialize_with_random_data is true. Only applies to fields that can contain NULL values. (default 0.1) + --null_probability float The probability to initialize a field with 'NULL' if --initialize-with-random-data is true. Only applies to fields that can contain NULL values. (default 0.1) --num_shards strings Comma separated shard count (one per keyspace) (default [2]) --onclose-timeout duration wait no more than this for OnClose handlers before stopping (default 10s) --onterm-timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) - --persistent_mode If this flag is set, the MySQL data directory is not cleaned up when LocalCluster.TearDown() is called. This is useful for running vttestserver as a database container in local developer environments. Note that db migration files (--schema_dir option) and seeding of random data (--initialize_with_random_data option) will only run during cluster startup if the data directory does not already exist. Changes to VSchema are persisted across cluster restarts using a simple watcher if the --data_dir argument is specified. + --persistent_mode If this flag is set, the MySQL data directory is not cleaned up when LocalCluster.TearDown() is called. This is useful for running vttestserver as a database container in local developer environments. Note that db migration files (--schema_dir option) and seeding of random data (--initialize-with-random-data option) will only run during cluster startup if the data directory does not already exist. Changes to VSchema are persisted across cluster restarts using a simple watcher if the --data_dir argument is specified. --pid-file string If set, the process will write its pid to the named file, and delete it on graceful shutdown. --planner-version string Sets the default planner to use when the session has not changed it. Valid values are: Gen4, Gen4Greedy, Gen4Left2Right - --pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled) + --pool-hostname-resolve-interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled) --port int Port to use for vtcombo. If this is 0, a random port will be chosen. --pprof strings enable profiling --pprof-http enable pprof http endpoints @@ -116,8 +116,8 @@ Flags: --queryserver-config-transaction-timeout duration query server transaction timeout, a transaction will be killed if it takes longer than this value (default 30s) --rdonly_count int Rdonly tablets per shard (default 1) --replica_count int Replica tablets per shard (includes primary) (default 2) - --replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) - --rng_seed int The random number generator seed to use when initializing with random data (see also --initialize_with_random_data). Multiple runs with the same seed will result with the same initial data. (default 123) + --replication-connect-retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s) + --rng_seed int The random number generator seed to use when initializing with random data (see also --initialize-with-random-data). Multiple runs with the same seed will result with the same initial data. (default 123) --schema_dir string Directory for initial schema files. Within this dir, there should be a subdir for each keyspace. Within each keyspace dir, each file is executed as SQL after the database is created on each shard. If the directory contains a vschema.json file, it will be used as the vschema for the V3 API. --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) --service-map strings comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice @@ -127,6 +127,7 @@ Flags: --stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1) --table-refresh-interval int interval in milliseconds to refresh tables in status page with refreshRequired class --tablet-dir string The directory within the vtdataroot to store vttablet/mysql files. Defaults to being generated by the tablet uid. + --tablet-hostname string The hostname to use for the tablet otherwise it will be derived from OS' hostname (default "localhost") --tablet-manager-grpc-ca string the server ca to use to validate servers when connecting --tablet-manager-grpc-cert string the cert to use to connect --tablet-manager-grpc-concurrency int concurrency to use to talk to a vttablet server for performance-sensitive RPCs (like ExecuteFetchAs{Dba,App}, CheckThrottler and FullStatus) (default 8) @@ -135,8 +136,7 @@ Flags: --tablet-manager-grpc-key string the key to use to connect --tablet-manager-grpc-server-name string the server name to use to validate server certificate --tablet-manager-protocol string Protocol to use to make tabletmanager RPCs to vttablets. (default "grpc") - --tablet_hostname string The hostname to use for the tablet otherwise it will be derived from OS' hostname (default "localhost") - --tablet_refresh_interval duration Interval at which vtgate refreshes tablet information from topology server. (default 10s) + --tablet-refresh-interval duration Interval at which vtgate refreshes tablet information from topology server. (default 10s) --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") --topo-consul-lock-session-ttl string TTL for consul session. @@ -165,10 +165,10 @@ Flags: --vtgate_grpc_key string the key to use to connect --vtgate_grpc_server_name string the server name to use to validate server certificate --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. + --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/stats/export.go b/go/stats/export.go index 1211f34b4a0..7f98cebb846 100644 --- a/go/stats/export.go +++ b/go/stats/export.go @@ -56,8 +56,7 @@ var ( var CommonTags []string func RegisterFlags(fs *pflag.FlagSet) { - fs.BoolVar(&emitStats, "emit_stats", emitStats, "If set, emit stats to push-based monitoring and stats backends") - + utils.SetFlagBoolVar(fs, &emitStats, "emit-stats", emitStats, "If set, emit stats to push-based monitoring and stats backends") utils.SetFlagDurationVar(fs, &statsEmitPeriod, "stats-emit-period", statsEmitPeriod, "Interval between emitting stats to all registered backends") utils.SetFlagStringVar(fs, &statsBackend, "stats-backend", statsBackend, "The name of the registered push-based monitoring/stats backend to use") utils.SetFlagStringVar(fs, &combineDimensions, "stats-combine-dimensions", combineDimensions, `List of dimensions to be combined into a single "all" value in exported stats vars`) diff --git a/go/test/endtoend/backup/vtbackup/backup_only_test.go b/go/test/endtoend/backup/vtbackup/backup_only_test.go index ec6cc4f83fe..8d52f335194 100644 --- a/go/test/endtoend/backup/vtbackup/backup_only_test.go +++ b/go/test/endtoend/backup/vtbackup/backup_only_test.go @@ -240,7 +240,7 @@ func startVtBackup(t *testing.T, initialBackup bool, restartBeforeBackup, disabl extraArgs := []string{ "--allow_first_backup", "--db-credentials-file", dbCredentialFile, - "--mysql_socket", mysqlSocket.Name(), + utils.GetFlagVariantForTests("--mysql-socket"), mysqlSocket.Name(), // Use opentsdb for stats. utils.GetFlagVariantForTests("--stats-backend"), "opentsdb", diff --git a/go/test/endtoend/backup/vtctlbackup/backup_utils.go b/go/test/endtoend/backup/vtctlbackup/backup_utils.go index f7e013f4ce4..fedb67bd988 100644 --- a/go/test/endtoend/backup/vtctlbackup/backup_utils.go +++ b/go/test/endtoend/backup/vtctlbackup/backup_utils.go @@ -46,6 +46,7 @@ import ( "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/sqlparser" + vtutils "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" ) @@ -143,16 +144,16 @@ func LaunchCluster(setupType int, streamMode string, stripes int, cDetails *Comp switch setupType { case XtraBackup: xtrabackupArgs := []string{ - "--backup_engine_implementation", "xtrabackup", - fmt.Sprintf("--xtrabackup_stream_mode=%s", streamMode), - "--xtrabackup_user=vt_dba", - fmt.Sprintf("--xtrabackup_stripes=%d", stripes), - "--xtrabackup_backup_flags", fmt.Sprintf("--password=%s", dbPassword), + vtutils.GetFlagVariantForTests("--backup-engine-implementation"), "xtrabackup", + fmt.Sprintf("%s=%s", vtutils.GetFlagVariantForTests("--xtrabackup-stream-mode"), streamMode), + fmt.Sprintf("%s=vt_dba", vtutils.GetFlagVariantForTests("--xtrabackup-user")), + fmt.Sprintf("%s=%d", vtutils.GetFlagVariantForTests("--xtrabackup-stripes"), stripes), + vtutils.GetFlagVariantForTests("--xtrabackup-backup-flags"), fmt.Sprintf("--password=%s", dbPassword), } // if streamMode is xbstream, add some additional args to test other xtrabackup flags if streamMode == "xbstream" { - xtrabackupArgs = append(xtrabackupArgs, "--xtrabackup_prepare_flags", "--use-memory=100M") + xtrabackupArgs = append(xtrabackupArgs, vtutils.GetFlagVariantForTests("--xtrabackup-prepare-flags"), "--use-memory=100M") } commonTabletArg = append(commonTabletArg, xtrabackupArgs...) @@ -164,7 +165,7 @@ func LaunchCluster(setupType int, streamMode string, stripes int, cDetails *Comp } mysqlShellArgs := []string{ - "--backup_engine_implementation", "mysqlshell", + vtutils.GetFlagVariantForTests("--backup-engine-implementation"), "mysqlshell", "--mysql-shell-backup-location", mysqlShellBackupLocation, } commonTabletArg = append(commonTabletArg, mysqlShellArgs...) @@ -344,15 +345,15 @@ func TestBackup(t *testing.T, setupType int, streamMode string, stripes int, cDe switch streamMode { case "xbstream": if vers.Major < 8 { - t.Logf("Skipping xtrabackup tests with --xtrabackup_stream_mode=xbstream as those are only tested on XtraBackup/MySQL 8.0+") + t.Logf("Skipping xtrabackup tests with --xtrabackup-stream-mode=xbstream as those are only tested on XtraBackup/MySQL 8.0+") return nil } - case "", "tar": // streaming method of tar is the default for the vttablet --xtrabackup_stream_mode flag + case "", "tar": // streaming method of tar is the default for the vttablet --xtrabackup-stream-mode flag // XtraBackup 8.0 must be used with MySQL 8.0 and it no longer supports tar as a stream method: // https://docs.percona.com/percona-xtrabackup/2.4/innobackupex/streaming_backups_innobackupex.html // https://docs.percona.com/percona-xtrabackup/8.0/xtrabackup_bin/backup.streaming.html if vers.Major > 5 { - t.Logf("Skipping xtrabackup tests with --xtrabackup_stream_mode=tar as tar is no longer a streaming option in XtraBackup 8.0") + t.Logf("Skipping xtrabackup tests with --xtrabackup-stream-mode=tar as tar is no longer a streaming option in XtraBackup 8.0") return nil } default: @@ -988,10 +989,10 @@ func restoreWaitForBackup(t *testing.T, tabletType string, cDetails *Compression replicaTabletArgs = updateCompressorArgs(replicaTabletArgs, cDetails) } if fakeImpl { - replicaTabletArgs = append(replicaTabletArgs, "--backup_engine_implementation", "fake_implementation") + replicaTabletArgs = append(replicaTabletArgs, vtutils.GetFlagVariantForTests("--backup-engine-implementation"), "fake_implementation") } replicaTabletArgs = append(replicaTabletArgs, "--wait_for_backup_interval", "1s") - replicaTabletArgs = append(replicaTabletArgs, "--init_tablet_type", tabletType) + replicaTabletArgs = append(replicaTabletArgs, vtutils.GetFlagVariantForTests("--init-tablet-type"), tabletType) replica2.VttabletProcess.ExtraArgs = replicaTabletArgs replica2.VttabletProcess.ServingStatus = "" err := replica2.VttabletProcess.Setup() diff --git a/go/test/endtoend/cluster/mysqlctl_process.go b/go/test/endtoend/cluster/mysqlctl_process.go index cfc4fc28088..397d0631788 100644 --- a/go/test/endtoend/cluster/mysqlctl_process.go +++ b/go/test/endtoend/cluster/mysqlctl_process.go @@ -54,6 +54,7 @@ type MysqlctlProcess struct { // InitDb executes mysqlctl command to add cell info func (mysqlctl *MysqlctlProcess) InitDb() (err error) { args := []string{"--log_dir", mysqlctl.LogDirectory, + //TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation "--tablet_uid", fmt.Sprintf("%d", mysqlctl.TabletUID), "--mysql_port", fmt.Sprintf("%d", mysqlctl.MySQLPort), "init", @@ -98,6 +99,7 @@ func (mysqlctl *MysqlctlProcess) StartProcess() (*exec.Cmd, error) { func (mysqlctl *MysqlctlProcess) startProcess(init bool) (*exec.Cmd, error) { tmpProcess := exec.Command( mysqlctl.Binary, + //TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation "--log_dir", mysqlctl.LogDirectory, "--tablet_uid", fmt.Sprintf("%d", mysqlctl.TabletUID), "--mysql_port", fmt.Sprintf("%d", mysqlctl.MySQLPort), @@ -227,6 +229,7 @@ func (mysqlctl *MysqlctlProcess) Stop() (err error) { func (mysqlctl *MysqlctlProcess) StopProcess() (*exec.Cmd, error) { tmpProcess := exec.Command( mysqlctl.Binary, + //TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation "--log_dir", mysqlctl.LogDirectory, "--tablet_uid", fmt.Sprintf("%d", mysqlctl.TabletUID), ) diff --git a/go/test/endtoend/cluster/mysqlctld_process.go b/go/test/endtoend/cluster/mysqlctld_process.go index 08409c1246d..003df184bb6 100644 --- a/go/test/endtoend/cluster/mysqlctld_process.go +++ b/go/test/endtoend/cluster/mysqlctld_process.go @@ -51,6 +51,7 @@ type MysqlctldProcess struct { // InitDb executes mysqlctld command to add cell info func (mysqlctld *MysqlctldProcess) InitDb() (err error) { args := []string{ + //TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation "--log_dir", mysqlctld.LogDirectory, "--tablet_uid", fmt.Sprintf("%d", mysqlctld.TabletUID), "--mysql_port", fmt.Sprintf("%d", mysqlctld.MySQLPort), @@ -73,6 +74,7 @@ func (mysqlctld *MysqlctldProcess) Start() error { } _ = createDirectory(mysqlctld.LogDirectory, 0700) args := []string{ + //TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation "--log_dir", mysqlctld.LogDirectory, "--tablet_uid", fmt.Sprintf("%d", mysqlctld.TabletUID), "--mysql_port", fmt.Sprintf("%d", mysqlctld.MySQLPort), @@ -160,6 +162,7 @@ func (mysqlctld *MysqlctldProcess) Stop() error { mysqlctld.exitSignalReceived = true tmpProcess := exec.Command( "mysqlctl", + //TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation "--tablet_uid", fmt.Sprintf("%d", mysqlctld.TabletUID), ) tmpProcess.Args = append(tmpProcess.Args, mysqlctld.ExtraArgs...) diff --git a/go/test/endtoend/cluster/vtbackup_process.go b/go/test/endtoend/cluster/vtbackup_process.go index b6d4d291368..6e3e10a444b 100644 --- a/go/test/endtoend/cluster/vtbackup_process.go +++ b/go/test/endtoend/cluster/vtbackup_process.go @@ -64,19 +64,23 @@ func (vtbackup *VtbackupProcess) Setup() (err error) { "--log_dir": vtbackup.LogDir, //initDBfile is required to run vtbackup - "--mysql_port": fmt.Sprintf("%d", vtbackup.MysqlPort), + "--mysql-port": fmt.Sprintf("%d", vtbackup.MysqlPort), "--init_db_sql_file": vtbackup.initDBfile, - "--init_keyspace": vtbackup.Keyspace, - "--init_shard": vtbackup.Shard, + "--init-keyspace": vtbackup.Keyspace, + "--init-shard": vtbackup.Shard, //Backup Arguments are not optional - "--backup_storage_implementation": vtbackup.BackupStorageImplementation, + "--backup-storage-implementation": vtbackup.BackupStorageImplementation, "--file_backup_storage_root": vtbackup.FileBackupStorageRoot, } utils.SetFlagVariantsForTests(flags, "--topo-implementation", vtbackup.TopoImplementation) utils.SetFlagVariantsForTests(flags, "--topo-global-server-address", vtbackup.TopoGlobalAddress) utils.SetFlagVariantsForTests(flags, "--topo-global-root", vtbackup.TopoGlobalRoot) + utils.SetFlagVariantsForTests(flags, "--mysql-port", fmt.Sprintf("%d", vtbackup.MysqlPort)) + utils.SetFlagVariantsForTests(flags, "--init-keyspace", vtbackup.Keyspace) + utils.SetFlagVariantsForTests(flags, "--init-shard", vtbackup.Shard) + utils.SetFlagVariantsForTests(flags, "--backup-storage-implementation", vtbackup.BackupStorageImplementation) vtbackup.proc = exec.Command(vtbackup.Binary) for k, v := range flags { diff --git a/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go b/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go index 36e1c725b1b..ba9a4422afc 100644 --- a/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go +++ b/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go @@ -444,10 +444,10 @@ func tmclientExtraArgs(name string) []string { func tabletConnExtraArgs(name string) []string { ca := "vttablet-server" - args := []string{"--tablet_grpc_cert", certDirectory + "/" + name + "-cert.pem", - "--tablet_grpc_key", certDirectory + "/" + name + "-key.pem", - "--tablet_grpc_ca", certDirectory + "/" + ca + "-cert.pem", - "--tablet_grpc_server_name", "vttablet server instance"} + args := []string{utils.GetFlagVariantForTests("--tablet-grpc-cert"), certDirectory + "/" + name + "-cert.pem", + utils.GetFlagVariantForTests("--tablet-grpc-key"), certDirectory + "/" + name + "-key.pem", + utils.GetFlagVariantForTests("--tablet-grpc-ca"), certDirectory + "/" + ca + "-cert.pem", + utils.GetFlagVariantForTests("--tablet-grpc-server-name"), "vttablet server instance"} return args } diff --git a/go/test/endtoend/mysqlserver/main_test.go b/go/test/endtoend/mysqlserver/main_test.go index 200dbc89a7c..5d6ddf59f9c 100644 --- a/go/test/endtoend/mysqlserver/main_test.go +++ b/go/test/endtoend/mysqlserver/main_test.go @@ -111,7 +111,7 @@ func TestMain(m *testing.M) { clusterInstance.VtGateExtraArgs = []string{ "--vschema_ddl_authorized_users=%", "--mysql_server_query_timeout", "1s", - "--mysql_auth_server_impl", "static", + utils.GetFlagVariantForTests("--mysql-auth-server-impl"), "static", "--mysql_auth_server_static_file", clusterInstance.TmpDirectory + mysqlAuthServerStatic, utils.GetFlagVariantForTests("--mysql-server-version"), "8.0.16-7", "--warn_sharded_only=true", diff --git a/go/test/endtoend/onlineddl/flow/onlineddl_flow_test.go b/go/test/endtoend/onlineddl/flow/onlineddl_flow_test.go index e794bbe9ab4..8f86c689fca 100644 --- a/go/test/endtoend/onlineddl/flow/onlineddl_flow_test.go +++ b/go/test/endtoend/onlineddl/flow/onlineddl_flow_test.go @@ -138,6 +138,7 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ + // TODO: Replace flag with dashed version in v25 "--heartbeat_interval", "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "2s", diff --git a/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go b/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go index 37e9377c406..cc2725c694b 100644 --- a/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go +++ b/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go @@ -156,7 +156,7 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ - "--heartbeat_interval", "250ms", + "--heartbeat-interval", "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "5s", "--watch_replication_stream", diff --git a/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go b/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go index 5ba9e9b2d76..5d904e96678 100644 --- a/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go +++ b/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go @@ -258,7 +258,7 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ - "--heartbeat_interval", "250ms", + "--heartbeat-interval", "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "2s", "--watch_replication_stream", diff --git a/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go b/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go index a7c38527152..8258c51f31c 100644 --- a/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go +++ b/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go @@ -179,7 +179,7 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ - "--heartbeat_interval", "250ms", + "--heartbeat-interval", "250ms", "--migration_check_interval", "5s", "--watch_replication_stream", } diff --git a/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go b/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go index f7b222c175d..68bc6e19f95 100644 --- a/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go +++ b/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go @@ -178,7 +178,7 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ - "--heartbeat_interval", "250ms", + "--heartbeat-interval", "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "5s", "--watch_replication_stream", diff --git a/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go b/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go index da6a8917de6..308f70f58fb 100644 --- a/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go +++ b/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go @@ -429,7 +429,7 @@ func TestMain(m *testing.M) { // thereby examining lastPK on vcopier side. We will be iterating tables using non-PK order throughout // this test suite, and so the low setting ensures we hit the more interesting code paths. clusterInstance.VtTabletExtraArgs = []string{ - "--heartbeat_interval", "250ms", + "--heartbeat-interval", "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "5s", "--vstream-packet-size", "4096", // Keep this value small and below 10k to ensure multilple vstream iterations diff --git a/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go b/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go index 4a2f7f1a3ce..e7801e748d7 100644 --- a/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go +++ b/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go @@ -88,6 +88,7 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ + // TODO: Replace flag with dashed version in v25 "--heartbeat_interval", "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "5s", diff --git a/go/test/endtoend/recovery/recovery_util.go b/go/test/endtoend/recovery/recovery_util.go index 7118507b685..23c484f3668 100644 --- a/go/test/endtoend/recovery/recovery_util.go +++ b/go/test/endtoend/recovery/recovery_util.go @@ -26,6 +26,7 @@ import ( "github.com/stretchr/testify/require" "vitess.io/vitess/go/test/endtoend/cluster" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtgate/vtgateconn" ) @@ -36,10 +37,10 @@ var ( UseXb = false // XbArgs are the arguments for specifying xtrabackup. XbArgs = []string{ - "--backup_engine_implementation", "xtrabackup", - "--xtrabackup_stream_mode=xbstream", - "--xtrabackup_user=vt_dba", - "--xtrabackup_backup_flags", fmt.Sprintf("--password=%s", dbPassword), + utils.GetFlagVariantForTests("--backup-engine-implementation"), "xtrabackup", + fmt.Sprintf("%s=xbstream", utils.GetFlagVariantForTests("--xtrabackup-stream-mode")), + fmt.Sprintf("%s=vt_dba", utils.GetFlagVariantForTests("--xtrabackup-user")), + utils.GetFlagVariantForTests("--xtrabackup-backup-flags"), fmt.Sprintf("--password=%s", dbPassword), } ) @@ -73,10 +74,10 @@ func RestoreTablet(t *testing.T, localCluster *cluster.LocalProcessCluster, tabl } replicaTabletArgs = append(replicaTabletArgs, "--disable_active_reparents", "--enable_replication_reporter=false", - "--init_tablet_type", "replica", - "--init_keyspace", restoreKSName, - "--init_shard", shardName, - "--init_db_name_override", "vt_"+keyspaceName, + utils.GetFlagVariantForTests("--init-tablet-type"), "replica", + utils.GetFlagVariantForTests("--init-keyspace"), restoreKSName, + utils.GetFlagVariantForTests("--init-shard"), shardName, + utils.GetFlagVariantForTests("--init-db-name-override"), "vt_"+keyspaceName, ) tablet.VttabletProcess.SupportsBackup = true tablet.VttabletProcess.ExtraArgs = replicaTabletArgs diff --git a/go/test/endtoend/reparent/newfeaturetest/reparent_test.go b/go/test/endtoend/reparent/newfeaturetest/reparent_test.go index ca9cbcefcf5..d5e6a5c4913 100644 --- a/go/test/endtoend/reparent/newfeaturetest/reparent_test.go +++ b/go/test/endtoend/reparent/newfeaturetest/reparent_test.go @@ -40,7 +40,7 @@ import ( // even when there are multiple vttablet failures. In this test we use the semi_sync policy // to allow multiple failures to happen and still be recoverable. // The test takes down the vttablets of the primary and a rdonly tablet and runs ERS with the -// default values of remote_operation_timeout, lock-timeout flags and wait_replicas_timeout subflag. +// default values of remote-operation-timeout, lock-timeout flags and wait_replicas_timeout subflag. func TestRecoverWithMultipleVttabletFailures(t *testing.T) { clusterInstance := utils.SetupReparentCluster(t, policy.DurabilitySemiSync) defer utils.TeardownCluster(clusterInstance) diff --git a/go/test/endtoend/schemadiff/vrepl/schemadiff_vrepl_suite_test.go b/go/test/endtoend/schemadiff/vrepl/schemadiff_vrepl_suite_test.go index c850e22945c..b0cd640ed2a 100644 --- a/go/test/endtoend/schemadiff/vrepl/schemadiff_vrepl_suite_test.go +++ b/go/test/endtoend/schemadiff/vrepl/schemadiff_vrepl_suite_test.go @@ -87,7 +87,7 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ - "--heartbeat_interval", "250ms", + "--heartbeat-interval", "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "5s", "--watch_replication_stream", diff --git a/go/test/endtoend/tabletgateway/buffer/buffer_test_helpers.go b/go/test/endtoend/tabletgateway/buffer/buffer_test_helpers.go index f2bd95f29ba..ad79302ca49 100644 --- a/go/test/endtoend/tabletgateway/buffer/buffer_test_helpers.go +++ b/go/test/endtoend/tabletgateway/buffer/buffer_test_helpers.go @@ -48,6 +48,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" + vtutils "vitess.io/vitess/go/vt/utils" ) const ( @@ -216,7 +217,7 @@ func (bt *BufferingTest) createCluster() (*cluster.LocalProcessCluster, int) { clusterInstance := cluster.NewCluster(cell, hostname) // Start topo server - clusterInstance.VtctldExtraArgs = []string{"--remote_operation_timeout", "30s", "--topo-etcd-lease-ttl", "40"} + clusterInstance.VtctldExtraArgs = []string{vtutils.GetFlagVariantForTests("--remote-operation-timeout"), "30s", "--topo-etcd-lease-ttl", "40"} if err := clusterInstance.StartTopo(); err != nil { return nil, 1 } @@ -241,7 +242,7 @@ func (bt *BufferingTest) createCluster() (*cluster.LocalProcessCluster, int) { "--buffer_window", "10m", "--buffer_max_failover_duration", "10m", "--buffer_min_time_between_failovers", "20m", - "--tablet_refresh_interval", "1s", + vtutils.GetFlagVariantForTests("--tablet-refresh-interval"), "1s", "--buffer_drain_concurrency", "4", } clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, bt.VtGateExtraArgs...) diff --git a/go/test/endtoend/tabletmanager/main_test.go b/go/test/endtoend/tabletmanager/main_test.go index b613f061522..16853f7536d 100644 --- a/go/test/endtoend/tabletmanager/main_test.go +++ b/go/test/endtoend/tabletmanager/main_test.go @@ -28,6 +28,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" tabletpb "vitess.io/vitess/go/vt/proto/topodata" + "vitess.io/vitess/go/vt/utils" tmc "vitess.io/vitess/go/vt/vttablet/grpctmclient" ) @@ -101,7 +102,7 @@ func TestMain(m *testing.M) { clusterInstance.VtTabletExtraArgs = []string{ "--lock_tables_timeout", "5s", "--watch_replication_stream", - "--heartbeat_enable", + utils.GetFlagVariantForTests("--heartbeat-enable"), "--health_check_interval", tabletHealthcheckRefreshInterval.String(), "--unhealthy_threshold", tabletUnhealthyThreshold.String(), "--twopc_abandon_age", "200", diff --git a/go/test/endtoend/tabletmanager/replication_manager/tablet_test.go b/go/test/endtoend/tabletmanager/replication_manager/tablet_test.go index 75c6e8d4cc8..9939caa3246 100644 --- a/go/test/endtoend/tabletmanager/replication_manager/tablet_test.go +++ b/go/test/endtoend/tabletmanager/replication_manager/tablet_test.go @@ -25,6 +25,7 @@ import ( "time" "vitess.io/vitess/go/vt/sidecardb" + "vitess.io/vitess/go/vt/utils" "github.com/stretchr/testify/require" @@ -129,8 +130,8 @@ func getTablet(tabletGrpcPort int) *tabletpb.Tablet { func resurrectTablet(t *testing.T, tab cluster.Vttablet) { // initialize config again to regenerate the my.cnf file which has the port to use _, err := tab.MysqlctlProcess.ExecuteCommandWithOutput("--log_dir", tab.MysqlctlProcess.LogDirectory, - "--tablet_uid", fmt.Sprintf("%d", tab.MysqlctlProcess.TabletUID), - "--mysql_port", fmt.Sprintf("%d", tab.MysqlctlProcess.MySQLPort), + utils.GetFlagVariantForTests("--tablet-uid"), fmt.Sprintf("%d", tab.MysqlctlProcess.TabletUID), + utils.GetFlagVariantForTests("--mysql-port"), fmt.Sprintf("%d", tab.MysqlctlProcess.MySQLPort), "init_config") require.NoError(t, err) diff --git a/go/test/endtoend/tabletmanager/tablegc/tablegc_test.go b/go/test/endtoend/tabletmanager/tablegc/tablegc_test.go index b1abec3a6b7..6b6407bb789 100644 --- a/go/test/endtoend/tabletmanager/tablegc/tablegc_test.go +++ b/go/test/endtoend/tabletmanager/tablegc/tablegc_test.go @@ -28,6 +28,7 @@ import ( "vitess.io/vitess/go/mysql/capabilities" "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vttablet/tabletserver/gc" "vitess.io/vitess/go/test/endtoend/cluster" @@ -100,7 +101,7 @@ func TestMain(m *testing.M) { "--lock_tables_timeout", "5s", "--watch_replication_stream", "--enable_replication_reporter", - "--heartbeat_interval", "250ms", + utils.GetFlagVariantForTests("--heartbeat-interval"), "250ms", "--gc_check_interval", gcCheckInterval.String(), "--gc_purge_check_interval", gcPurgeCheckInterval.String(), "--table_gc_lifecycle", "hold,purge,evac,drop", diff --git a/go/test/endtoend/tabletmanager/tablet_health_test.go b/go/test/endtoend/tabletmanager/tablet_health_test.go index acfab5f01a8..79aa4c58f5f 100644 --- a/go/test/endtoend/tabletmanager/tablet_health_test.go +++ b/go/test/endtoend/tabletmanager/tablet_health_test.go @@ -58,13 +58,13 @@ func TestTabletReshuffle(t *testing.T) { // Create new tablet rTablet := clusterInstance.NewVttabletInstance("replica", 0, "") - // mycnf_server_id prevents vttablet from reading the mycnf + // mycnf-server-id prevents vttablet from reading the mycnf // Pointing to primaryTablet's socket file // We have to disable active reparenting to prevent the tablet from trying to fix replication. // We also have to disable replication reporting because we're pointed at the primary. clusterInstance.VtTabletExtraArgs = []string{ "--lock_tables_timeout", "5s", - "--mycnf_server_id", fmt.Sprintf("%d", rTablet.TabletUID), + vtutils.GetFlagVariantForTests("--mycnf-server-id"), fmt.Sprintf("%d", rTablet.TabletUID), vtutils.GetFlagVariantForTests("--db-socket"), fmt.Sprintf("%s/mysql.sock", primaryTablet.VttabletProcess.Directory), "--disable_active_reparents", "--enable_replication_reporter=false", diff --git a/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go b/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go index 842c3a949a0..3090e9db25f 100644 --- a/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go +++ b/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go @@ -32,6 +32,7 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/throttler" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/base" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" @@ -107,7 +108,7 @@ func TestMain(m *testing.M) { "--lock_tables_timeout", "5s", "--watch_replication_stream", "--enable_replication_reporter", - "--heartbeat_interval", "250ms", + utils.GetFlagVariantForTests("--heartbeat-interval"), "250ms", "--heartbeat_on_demand_duration", onDemandHeartbeatDuration.String(), "--disable_active_reparents", } diff --git a/go/test/endtoend/transaction/twopc/fuzz/main_test.go b/go/test/endtoend/transaction/twopc/fuzz/main_test.go index 90ce9385102..f299c8303e3 100644 --- a/go/test/endtoend/transaction/twopc/fuzz/main_test.go +++ b/go/test/endtoend/transaction/twopc/fuzz/main_test.go @@ -68,7 +68,7 @@ func TestMain(m *testing.M) { clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--transaction_mode", "TWOPC", vtutils.GetFlagVariantForTests("--grpc-use-effective-callerid"), - "--tablet_refresh_interval", "2s", + vtutils.GetFlagVariantForTests("--tablet-refresh-interval"), "2s", ) clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--twopc_abandon_age", "1", diff --git a/go/test/endtoend/transaction/twopc/stress/main_test.go b/go/test/endtoend/transaction/twopc/stress/main_test.go index 0bfb67834d1..55c4271646b 100644 --- a/go/test/endtoend/transaction/twopc/stress/main_test.go +++ b/go/test/endtoend/transaction/twopc/stress/main_test.go @@ -68,7 +68,7 @@ func TestMain(m *testing.M) { clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--transaction_mode", "TWOPC", vtutils.GetFlagVariantForTests("--grpc-use-effective-callerid"), - "--tablet_refresh_interval", "2s", + vtutils.GetFlagVariantForTests("--tablet-refresh-interval"), "2s", ) clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--twopc_abandon_age", "1", diff --git a/go/test/endtoend/vault/vault_test.go b/go/test/endtoend/vault/vault_test.go index 267d36817b3..82916db6769 100644 --- a/go/test/endtoend/vault/vault_test.go +++ b/go/test/endtoend/vault/vault_test.go @@ -80,7 +80,7 @@ var ( // Make this small, so we can get a renewal "--db-credentials-vault-ttl", "21s"} vaultVTGateArg = []string{ - "--mysql_auth_server_impl", "vault", + vtutils.GetFlagVariantForTests("--mysql-auth-server-impl"), "vault", "--mysql_auth_vault_timeout", "3s", "--mysql_auth_vault_path", "kv/prod/vtgatecreds", // This is overriden by our env VAULT_ADDR diff --git a/go/test/endtoend/vreplication/cluster_test.go b/go/test/endtoend/vreplication/cluster_test.go index 9ccee84c539..1fa1f58adaa 100644 --- a/go/test/endtoend/vreplication/cluster_test.go +++ b/go/test/endtoend/vreplication/cluster_test.go @@ -38,6 +38,7 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/mysqlctl" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" @@ -54,10 +55,10 @@ var ( sidecarDBIdentifier = sqlparser.String(sqlparser.NewIdentifierCS(sidecarDBName)) mainClusterConfig *ClusterConfig externalClusterConfig *ClusterConfig - extraVTGateArgs = []string{"--tablet_refresh_interval", "10ms", "--enable_buffer", "--buffer_window", loadTestBufferingWindowDuration.String(), + extraVTGateArgs = []string{utils.GetFlagVariantForTests("--tablet-refresh-interval"), "10ms", "--enable_buffer", "--buffer_window", loadTestBufferingWindowDuration.String(), "--buffer_size", "250000", "--buffer_min_time_between_failovers", "1s", "--buffer_max_failover_duration", loadTestBufferingWindowDuration.String(), "--buffer_drain_concurrency", "10"} - extraVtctldArgs = []string{"--remote_operation_timeout", "600s", "--topo-etcd-lease-ttl", "120"} + extraVtctldArgs = []string{utils.GetFlagVariantForTests("--remote-operation-timeout"), "600s", "--topo-etcd-lease-ttl", "120"} // This variable can be used within specific tests to alter vttablet behavior. extraVTTabletArgs = []string{} @@ -495,7 +496,7 @@ func (vc *VitessCluster) AddTablet(t testing.TB, cell *Cell, keyspace *Keyspace, var options []string defaultHeartbeatOptions := []string{ "--heartbeat_on_demand_duration", "5s", - "--heartbeat_interval", "250ms", + utils.GetFlagVariantForTests("--heartbeat-interval"), "250ms", } if !mainClusterConfig.overrideHeartbeatOptions { options = append(options, defaultHeartbeatOptions...) diff --git a/go/test/endtoend/vreplication/vstream_test.go b/go/test/endtoend/vreplication/vstream_test.go index f37ba1750f0..354f8688929 100644 --- a/go/test/endtoend/vreplication/vstream_test.go +++ b/go/test/endtoend/vreplication/vstream_test.go @@ -29,6 +29,7 @@ import ( "github.com/stretchr/testify/require" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/utils" _ "vitess.io/vitess/go/vt/vtgate/grpcvtgateconn" "vitess.io/vitess/go/vt/vtgate/vtgateconn" @@ -1035,8 +1036,8 @@ func doVStream(t *testing.T, vc *VitessCluster, flags *vtgatepb.VStreamFlags) (n func TestVStreamHeartbeats(t *testing.T) { // Enable continuous heartbeats. extraVTTabletArgs = append(extraVTTabletArgs, - "--heartbeat_enable", - "--heartbeat_interval", "1s", + utils.GetFlagVariantForTests("--heartbeat-enable"), + utils.GetFlagVariantForTests("--heartbeat-interval"), "1s", "--heartbeat_on_demand_duration", "0", ) setSidecarDBName("_vt") diff --git a/go/test/endtoend/vtgate/foreignkey/stress/fk_stress_test.go b/go/test/endtoend/vtgate/foreignkey/stress/fk_stress_test.go index 42498ad80f0..d8dbfb33b8e 100644 --- a/go/test/endtoend/vtgate/foreignkey/stress/fk_stress_test.go +++ b/go/test/endtoend/vtgate/foreignkey/stress/fk_stress_test.go @@ -44,6 +44,7 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" + vtutils "vitess.io/vitess/go/vt/utils" ) // This endtoend test is designd to validate VTGate's FOREIGN KEY implementation for unsharded/single-sharded/shard-scope, meaning @@ -354,8 +355,8 @@ func TestMain(m *testing.M) { } clusterInstance.VtTabletExtraArgs = []string{ - "--heartbeat_enable", - "--heartbeat_interval", "250ms", + vtutils.GetFlagVariantForTests("--heartbeat-enable"), + vtutils.GetFlagVariantForTests("--heartbeat-interval"), "250ms", "--heartbeat_on_demand_duration", "5s", "--migration_check_interval", "3s", "--watch_replication_stream", diff --git a/go/test/endtoend/vtgate/tablet_healthcheck/reparent_test.go b/go/test/endtoend/vtgate/tablet_healthcheck/reparent_test.go index 77e9a58cf69..b066a622362 100644 --- a/go/test/endtoend/vtgate/tablet_healthcheck/reparent_test.go +++ b/go/test/endtoend/vtgate/tablet_healthcheck/reparent_test.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -113,7 +114,7 @@ func TestMain(m *testing.M) { return 1 } - clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, []string{"--tablet_refresh_interval", tabletRefreshInterval.String()}...) + clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, []string{utils.GetFlagVariantForTests("--tablet-refresh-interval"), tabletRefreshInterval.String()}...) err = clusterInstance.StartVtgate() if err != nil { return 1 diff --git a/go/test/endtoend/vtgate/tablet_healthcheck_cache/correctness_test.go b/go/test/endtoend/vtgate/tablet_healthcheck_cache/correctness_test.go index 3457a2cab3c..f0b40b9e653 100644 --- a/go/test/endtoend/vtgate/tablet_healthcheck_cache/correctness_test.go +++ b/go/test/endtoend/vtgate/tablet_healthcheck_cache/correctness_test.go @@ -30,6 +30,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -110,7 +111,7 @@ func TestMain(m *testing.M) { return 1 } - clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, []string{"--tablet_refresh_interval", tabletRefreshInterval.String()}...) + clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, []string{utils.GetFlagVariantForTests("--tablet-refresh-interval"), tabletRefreshInterval.String()}...) err = clusterInstance.StartVtgate() if err != nil { return 1 @@ -158,7 +159,7 @@ func TestHealthCheckCacheWithTabletChurn(t *testing.T) { deleteTablet(t, tablet) expectedTabletHCcacheEntries-- - // We need to sleep for at least vtgate's --tablet_refresh_interval to be sure we + // We need to sleep for at least vtgate's --tablet-refresh-interval to be sure we // have resynchronized the healthcheck cache with the topo server via the topology // watcher and pruned the deleted tablet from the healthcheck cache. time.Sleep(tabletRefreshInterval) diff --git a/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go b/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go index de60420eee3..761ce35e66e 100644 --- a/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go +++ b/go/test/endtoend/vtorc/primaryfailure/primary_failure_test.go @@ -31,6 +31,7 @@ import ( "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/vtorc/utils" + vtutils "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" "vitess.io/vitess/go/vt/vtorc/logic" ) @@ -43,7 +44,7 @@ func TestDownPrimary(t *testing.T) { // We specify the --wait-replicas-timeout to a small value because we spawn a cross-cell replica later in the test. // If that replica is more advanced than the same-cell-replica, then we try to promote the cross-cell replica as an intermediate source. // If we don't specify a small value of --wait-replicas-timeout, then we would end up waiting for 30 seconds for the dead-primary to respond, failing this test. - utils.SetupVttabletsAndVTOrcs(t, clusterInfo, 2, 1, []string{"--remote_operation_timeout=10s", "--wait-replicas-timeout=5s"}, cluster.VTOrcConfiguration{ + utils.SetupVttabletsAndVTOrcs(t, clusterInfo, 2, 1, []string{fmt.Sprintf("%s=10s", vtutils.GetFlagVariantForTests("--remote-operation-timeout")), "--wait-replicas-timeout=5s"}, cluster.VTOrcConfiguration{ PreventCrossCellFailover: true, }, 1, policy.DurabilitySemiSync) keyspace := &clusterInfo.ClusterInstance.Keyspaces[0] @@ -148,7 +149,7 @@ func TestDownPrimaryBeforeVTOrc(t *testing.T) { require.NoError(t, err) // Start a VTOrc instance - utils.StartVTOrcs(t, clusterInfo, []string{"--remote_operation_timeout=10s"}, cluster.VTOrcConfiguration{ + utils.StartVTOrcs(t, clusterInfo, []string{fmt.Sprintf("%s=10s", vtutils.GetFlagVariantForTests("--remote-operation-timeout"))}, cluster.VTOrcConfiguration{ PreventCrossCellFailover: true, }, 1) @@ -171,7 +172,7 @@ func TestDownPrimaryBeforeVTOrc(t *testing.T) { // delete the primary record and let vtorc repair. func TestDeletedPrimaryTablet(t *testing.T) { defer utils.PrintVTOrcLogsOnFailure(t, clusterInfo.ClusterInstance) - utils.SetupVttabletsAndVTOrcs(t, clusterInfo, 2, 1, []string{"--remote_operation_timeout=10s"}, cluster.VTOrcConfiguration{}, 1, policy.DurabilityNone) + utils.SetupVttabletsAndVTOrcs(t, clusterInfo, 2, 1, []string{fmt.Sprintf("%s=10s", vtutils.GetFlagVariantForTests("--remote-operation-timeout"))}, cluster.VTOrcConfiguration{}, 1, policy.DurabilityNone) keyspace := &clusterInfo.ClusterInstance.Keyspaces[0] shard0 := &keyspace.Shards[0] // find primary from topo @@ -240,7 +241,7 @@ func TestDeadPrimaryRecoversImmediately(t *testing.T) { // We specify the --wait-replicas-timeout to a small value because we spawn a cross-cell replica later in the test. // If that replica is more advanced than the same-cell-replica, then we try to promote the cross-cell replica as an intermediate source. // If we don't specify a small value of --wait-replicas-timeout, then we would end up waiting for 30 seconds for the dead-primary to respond, failing this test. - utils.SetupVttabletsAndVTOrcs(t, clusterInfo, 2, 1, []string{"--remote_operation_timeout=10s", "--wait-replicas-timeout=5s"}, cluster.VTOrcConfiguration{ + utils.SetupVttabletsAndVTOrcs(t, clusterInfo, 2, 1, []string{"--remote-operation-timeout=10s", "--wait-replicas-timeout=5s"}, cluster.VTOrcConfiguration{ PreventCrossCellFailover: true, }, 1, policy.DurabilitySemiSync) keyspace := &clusterInfo.ClusterInstance.Keyspaces[0] @@ -309,8 +310,8 @@ func TestDeadPrimaryRecoversImmediately(t *testing.T) { } diff := time2.Sub(time1) fmt.Printf("The difference between %s and %s is %v seconds.\n", t1, t2, diff.Seconds()) - // assert that it takes less than `remote_operation_timeout` to recover from `DeadPrimary` - // use the value provided in `remote_operation_timeout` flag to compare with. + // assert that it takes less than `remote-operation-timeout` to recover from `DeadPrimary` + // use the value provided in `remote-operation-timeout` flag to compare with. // We are testing against 9.5 seconds to be safe and prevent flakiness. assert.Less(t, diff.Seconds(), 9.5) } diff --git a/go/test/fuzzing/vtctl_fuzzer.dict b/go/test/fuzzing/vtctl_fuzzer.dict index 65fb5999575..bb253a8cc49 100644 --- a/go/test/fuzzing/vtctl_fuzzer.dict +++ b/go/test/fuzzing/vtctl_fuzzer.dict @@ -44,7 +44,7 @@ "-db_name_override" "-dry-run" "-hostname" -"-mysql_port" +"-mysql-port" "-port" "-grpc-port" "-tags" diff --git a/go/vt/discovery/healthcheck.go b/go/vt/discovery/healthcheck.go index 158f6c83258..79391a40134 100644 --- a/go/vt/discovery/healthcheck.go +++ b/go/vt/discovery/healthcheck.go @@ -61,6 +61,7 @@ import ( "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/topotools" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vttablet/queryservice" ) @@ -179,9 +180,10 @@ func registerDiscoveryFlags(fs *pflag.FlagSet) { } 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.") + utils.SetFlagStringVar(fs, &TabletURLTemplateString, "tablet-url-template", "http://{{.GetTabletHostPort}}", "Format string describing debug tablet url formatting. See getTabletDebugURL() for how to customize this.") + utils.SetFlagDurationVar(fs, &refreshInterval, "tablet-refresh-interval", 1*time.Minute, "Tablet refresh interval.") + utils.SetFlagBoolVar(fs, &refreshKnownTablets, "tablet-refresh-known-tablets", true, "Whether to reload the tablet's address/port map from topo in case they change.") + ParseTabletURLTemplateFromFlag() } diff --git a/go/vt/mysqlctl/azblobbackupstorage/azblob.go b/go/vt/mysqlctl/azblobbackupstorage/azblob.go index dbd146495e8..3005b12e012 100644 --- a/go/vt/mysqlctl/azblobbackupstorage/azblob.go +++ b/go/vt/mysqlctl/azblobbackupstorage/azblob.go @@ -33,6 +33,7 @@ import ( "github.com/spf13/pflag" "vitess.io/vitess/go/vt/mysqlctl/errors" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/viperutil" "vitess.io/vitess/go/vt/log" @@ -46,7 +47,7 @@ var ( configKey("account.name"), viperutil.Options[string]{ EnvVars: []string{"VT_AZBLOB_ACCOUNT_NAME"}, - FlagName: "azblob_backup_account_name", + FlagName: "azblob-backup-account-name", }, ) @@ -54,7 +55,7 @@ var ( accountKeyFile = viperutil.Configure( configKey("account.key_file"), viperutil.Options[string]{ - FlagName: "azblob_backup_account_key_file", + FlagName: "azblob-backup-account-key-file", }, ) @@ -62,7 +63,7 @@ var ( containerName = viperutil.Configure( configKey("container_name"), viperutil.Options[string]{ - FlagName: "azblob_backup_container_name", + FlagName: "azblob-backup-container-name", }, ) @@ -70,7 +71,7 @@ var ( storageRoot = viperutil.Configure( configKey("storage_root"), viperutil.Options[string]{ - FlagName: "azblob_backup_storage_root", + FlagName: "azblob-backup-storage-root", }, ) @@ -86,7 +87,7 @@ var ( configKey("parallelism"), viperutil.Options[int]{ Default: 1, - FlagName: "azblob_backup_parallelism", + FlagName: "azblob-backup-parallelism", }, ) ) @@ -96,12 +97,19 @@ const configKeyPrefix = "backup.storage.azblob" var configKey = viperutil.KeyPrefixFunc(configKeyPrefix) func registerFlags(fs *pflag.FlagSet) { - fs.String("azblob_backup_account_name", accountName.Default(), "Azure Storage Account name for backups; if this flag is unset, the environment variable VT_AZBLOB_ACCOUNT_NAME will be used.") - fs.String("azblob_backup_account_key_file", accountKeyFile.Default(), "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).") - fs.String("azblob_backup_container_name", containerName.Default(), "Azure Blob Container Name.") - fs.String("azblob_backup_storage_root", storageRoot.Default(), "Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/').") - fs.Int("azblob_backup_buffer_size", azBlobBufferSize.Default(), "The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service.") - fs.Int("azblob_backup_parallelism", azBlobParallelism.Default(), "Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob_backup_buffer_size).") + accountNameValue := accountName.Get() + accountKeyFileValue := accountKeyFile.Get() + containerNameValue := containerName.Get() + storageRootValue := storageRoot.Get() + azBlobBufferSizeValue := azBlobBufferSize.Get() + azBlobParallelismValue := azBlobParallelism.Get() + + utils.SetFlagStringVar(fs, &accountNameValue, "azblob-backup-account-name", accountName.Default(), "Azure Storage Account name for backups; if this flag is unset, the environment variable VT_AZBLOB_ACCOUNT_NAME will be used.") + utils.SetFlagStringVar(fs, &accountKeyFileValue, "azblob-backup-account-key-file", accountKeyFile.Default(), "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).") + utils.SetFlagStringVar(fs, &containerNameValue, "azblob-backup-container-name", containerName.Default(), "Azure Blob Container Name.") + utils.SetFlagStringVar(fs, &storageRootValue, "azblob-backup-storage-root", storageRoot.Default(), "Root prefix for all backup-related Azure Blobs; this should exclude both initial and trailing '/' (e.g. just 'a/b' not '/a/b/').") + utils.SetFlagIntVar(fs, &azBlobBufferSizeValue, "azblob-backup-buffer-size", azBlobBufferSize.Default(), "The memory buffer size to use in bytes, per file or stripe, when streaming to Azure Blob Service.") + utils.SetFlagIntVar(fs, &azBlobParallelismValue, "azblob-backup-parallelism", azBlobParallelism.Default(), "Azure Blob operation parallelism (requires extra memory when increased -- a multiple of azblob-backup-buffer-size).") viperutil.BindFlags(fs, accountName, accountKeyFile, containerName, storageRoot, azBlobParallelism) } @@ -120,7 +128,7 @@ const ( // Return a Shared credential from the available credential sources. // We will use credentials in the following order -// 1. Direct Command Line Flag (azblob_backup_account_name, azblob_backup_account_key) +// 1. Direct Command Line Flag (azblob-backup-account-name, azblob-backup-account-key) // 2. Environment variables func azInternalCredentials() (string, string, error) { actName := accountName.Get() @@ -449,7 +457,7 @@ func (bs *AZBlobBackupStorage) WithParams(params backupstorage.Params) backupsto // objName joins path parts into an object name. // Unlike path.Join, it doesn't collapse ".." or strip trailing slashes. -// It also adds the value of the -azblob_backup_storage_root flag if set. +// It also adds the value of the -azblob-backup-storage-root flag if set. func objName(parts ...string) string { if root := storageRoot.Get(); root != "" { return root + "/" + strings.Join(parts, "/") diff --git a/go/vt/mysqlctl/backup.go b/go/vt/mysqlctl/backup.go index 1cde68b28b7..99b9a6fc748 100644 --- a/go/vt/mysqlctl/backup.go +++ b/go/vt/mysqlctl/backup.go @@ -37,6 +37,7 @@ import ( "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" topodatapb "vitess.io/vitess/go/vt/proto/topodata" @@ -112,9 +113,9 @@ func ParseBinlogTimestamp(timestamp string) (time.Time, error) { } func registerBackupFlags(fs *pflag.FlagSet) { - fs.BoolVar(&backupStorageCompress, "backup_storage_compress", backupStorageCompress, "if set, the backup files will be compressed.") - fs.IntVar(&backupCompressBlockSize, "backup_storage_block_size", backupCompressBlockSize, "if backup_storage_compress is true, backup_storage_block_size sets the byte size for each block while compressing (default is 250000).") - fs.IntVar(&backupCompressBlocks, "backup_storage_number_blocks", backupCompressBlocks, "if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression.") + utils.SetFlagBoolVar(fs, &backupStorageCompress, "backup-storage-compress", backupStorageCompress, "if set, the backup files will be compressed.") + utils.SetFlagIntVar(fs, &backupCompressBlockSize, "backup-storage-block-size", backupCompressBlockSize, "if backup-storage-compress is true, backup-storage-block-size sets the byte size for each block while compressing (default is 250000).") + utils.SetFlagIntVar(fs, &backupCompressBlocks, "backup-storage-number-blocks", backupCompressBlocks, "if backup-storage-compress is true, backup-storage-number-blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression.") } // Backup is the main entry point for a backup: diff --git a/go/vt/mysqlctl/backupengine.go b/go/vt/mysqlctl/backupengine.go index c5700a3cfd4..55ee19ec8f2 100644 --- a/go/vt/mysqlctl/backupengine.go +++ b/go/vt/mysqlctl/backupengine.go @@ -39,6 +39,7 @@ import ( "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" ) @@ -211,7 +212,7 @@ func isIncrementalBackup(params BackupParams) bool { } func registerBackupEngineFlags(fs *pflag.FlagSet) { - fs.StringVar(&backupEngineImplementation, "backup_engine_implementation", backupEngineImplementation, "Specifies which implementation to use for creating new backups (builtin or xtrabackup). Restores will always be done with whichever engine created a given backup.") + utils.SetFlagStringVar(fs, &backupEngineImplementation, "backup-engine-implementation", backupEngineImplementation, "Specifies which implementation to use for creating new backups (builtin or xtrabackup). Restores will always be done with whichever engine created a given backup.") } // GetBackupEngine returns the BackupEngine implementation that should be used diff --git a/go/vt/mysqlctl/backupstorage/interface.go b/go/vt/mysqlctl/backupstorage/interface.go index 4fd37b3163a..917256b865d 100644 --- a/go/vt/mysqlctl/backupstorage/interface.go +++ b/go/vt/mysqlctl/backupstorage/interface.go @@ -26,6 +26,7 @@ import ( "github.com/spf13/pflag" "vitess.io/vitess/go/vt/mysqlctl/errors" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/servenv" ) @@ -41,7 +42,7 @@ var ( ) func registerBackupFlags(fs *pflag.FlagSet) { - fs.StringVar(&BackupStorageImplementation, "backup_storage_implementation", "", "Which backup storage implementation to use for creating and restoring backups.") + utils.SetFlagStringVar(fs, &BackupStorageImplementation, "backup-storage-implementation", "", "Which backup storage implementation to use for creating and restoring backups.") } func init() { diff --git a/go/vt/mysqlctl/builtinbackupengine.go b/go/vt/mysqlctl/builtinbackupengine.go index 491a2f2b35c..b5efdec77bb 100644 --- a/go/vt/mysqlctl/builtinbackupengine.go +++ b/go/vt/mysqlctl/builtinbackupengine.go @@ -48,6 +48,7 @@ import ( "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vttablet/tmclient" @@ -167,8 +168,8 @@ func init() { } func registerBuiltinBackupEngineFlags(fs *pflag.FlagSet) { - fs.DurationVar(&BuiltinBackupMysqldTimeout, "builtinbackup_mysqld_timeout", BuiltinBackupMysqldTimeout, "how long to wait for mysqld to shutdown at the start of the backup.") - fs.DurationVar(&builtinBackupProgress, "builtinbackup_progress", builtinBackupProgress, "how often to send progress updates when backing up large files.") + utils.SetFlagDurationVar(fs, &BuiltinBackupMysqldTimeout, "builtinbackup-mysqld-timeout", BuiltinBackupMysqldTimeout, "how long to wait for mysqld to shutdown at the start of the backup.") + utils.SetFlagDurationVar(fs, &builtinBackupProgress, "builtinbackup-progress", builtinBackupProgress, "how often to send progress updates when backing up large files.") fs.UintVar(&builtinBackupFileReadBufferSize, "builtinbackup-file-read-buffer-size", builtinBackupFileReadBufferSize, "read files using an IO buffer of this many bytes. Golang defaults are used when set to 0.") fs.UintVar(&builtinBackupFileWriteBufferSize, "builtinbackup-file-write-buffer-size", builtinBackupFileWriteBufferSize, "write files using an IO buffer of this many bytes. Golang defaults are used when set to 0.") fs.StringVar(&builtinIncrementalRestorePath, "builtinbackup-incremental-restore-path", builtinIncrementalRestorePath, "the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed.") diff --git a/go/vt/mysqlctl/gcsbackupstorage/gcs.go b/go/vt/mysqlctl/gcsbackupstorage/gcs.go index adecbb9bbba..8d88eb176c4 100644 --- a/go/vt/mysqlctl/gcsbackupstorage/gcs.go +++ b/go/vt/mysqlctl/gcsbackupstorage/gcs.go @@ -33,6 +33,7 @@ import ( "google.golang.org/api/option" "vitess.io/vitess/go/vt/mysqlctl/errors" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/trace" "vitess.io/vitess/go/vt/mysqlctl/backupstorage" @@ -48,8 +49,8 @@ var ( ) func registerFlags(fs *pflag.FlagSet) { - fs.StringVar(&bucket, "gcs_backup_storage_bucket", "", "Google Cloud Storage bucket to use for backups.") - fs.StringVar(&root, "gcs_backup_storage_root", "", "Root prefix for all backup-related object names.") + utils.SetFlagStringVar(fs, &bucket, "gcs-backup-storage-bucket", "", "Google Cloud Storage bucket to use for backups.") + utils.SetFlagStringVar(fs, &root, "gcs-backup-storage-root", "", "Root prefix for all backup-related object names.") } func init() { @@ -271,7 +272,7 @@ func (bs *GCSBackupStorage) client(ctx context.Context) (*storage.Client, error) // objName joins path parts into an object name. // Unlike path.Join, it doesn't collapse ".." or strip trailing slashes. -// It also adds the value of the --gcs_backup_storage_root flag if set. +// It also adds the value of the --gcs-backup-storage-root flag if set. func objName(parts ...string) string { if root != "" { return root + "/" + strings.Join(parts, "/") diff --git a/go/vt/mysqlctl/mycnf_flag.go b/go/vt/mysqlctl/mycnf_flag.go index 8559e5c1431..70d5c601916 100644 --- a/go/vt/mysqlctl/mycnf_flag.go +++ b/go/vt/mysqlctl/mycnf_flag.go @@ -23,6 +23,7 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" ) // This file handles using command line flags to create a Mycnf object. @@ -62,23 +63,23 @@ const ( // to get the supported modes. func RegisterFlags() { servenv.OnParse(func(fs *pflag.FlagSet) { - fs.IntVar(&flagServerID, "mycnf_server_id", flagServerID, "mysql server id of the server (if specified, mycnf-file will be ignored)") - fs.IntVar(&flagMysqlPort, "mycnf_mysql_port", flagMysqlPort, "port mysql is listening on") - fs.StringVar(&flagDataDir, "mycnf_data_dir", flagDataDir, "data directory for mysql") - fs.StringVar(&flagInnodbDataHomeDir, "mycnf_innodb_data_home_dir", flagInnodbDataHomeDir, "Innodb data home directory") - fs.StringVar(&flagInnodbLogGroupHomeDir, "mycnf_innodb_log_group_home_dir", flagInnodbLogGroupHomeDir, "Innodb log group home directory") - fs.StringVar(&flagSocketFile, "mycnf_socket_file", flagSocketFile, "mysql socket file") - fs.StringVar(&flagGeneralLogPath, "mycnf_general_log_path", flagGeneralLogPath, "mysql general log path") - fs.StringVar(&flagErrorLogPath, "mycnf_error_log_path", flagErrorLogPath, "mysql error log path") - fs.StringVar(&flagSlowLogPath, "mycnf_slow_log_path", flagSlowLogPath, "mysql slow query log path") - fs.StringVar(&flagRelayLogPath, "mycnf_relay_log_path", flagRelayLogPath, "mysql relay log path") - fs.StringVar(&flagRelayLogIndexPath, "mycnf_relay_log_index_path", flagRelayLogIndexPath, "mysql relay log index path") - fs.StringVar(&flagRelayLogInfoPath, "mycnf_relay_log_info_path", flagRelayLogInfoPath, "mysql relay log info path") - fs.StringVar(&flagBinLogPath, "mycnf_bin_log_path", flagBinLogPath, "mysql binlog path") - fs.StringVar(&flagMasterInfoFile, "mycnf_master_info_file", flagMasterInfoFile, "mysql master.info file") - fs.StringVar(&flagPidFile, "mycnf_pid_file", flagPidFile, "mysql pid file") - fs.StringVar(&flagTmpDir, "mycnf_tmp_dir", flagTmpDir, "mysql tmp directory") - fs.StringVar(&flagSecureFilePriv, "mycnf_secure_file_priv", flagSecureFilePriv, "mysql path for loading secure files") + utils.SetFlagIntVar(fs, &flagServerID, "mycnf-server-id", flagServerID, "mysql server id of the server (if specified, mycnf-file will be ignored)") + utils.SetFlagIntVar(fs, &flagMysqlPort, "mycnf-mysql-port", flagMysqlPort, "port mysql is listening on") + utils.SetFlagStringVar(fs, &flagDataDir, "mycnf-data-dir", flagDataDir, "data directory for mysql") + utils.SetFlagStringVar(fs, &flagInnodbDataHomeDir, "mycnf-innodb-data-home-dir", flagInnodbDataHomeDir, "Innodb data home directory") + utils.SetFlagStringVar(fs, &flagInnodbLogGroupHomeDir, "mycnf-innodb-log-group-home-dir", flagInnodbLogGroupHomeDir, "Innodb log group home directory") + utils.SetFlagStringVar(fs, &flagSocketFile, "mycnf-socket-file", flagSocketFile, "mysql socket file") + utils.SetFlagStringVar(fs, &flagGeneralLogPath, "mycnf-general-log-path", flagGeneralLogPath, "mysql general log path") + utils.SetFlagStringVar(fs, &flagErrorLogPath, "mycnf-error-log-path", flagErrorLogPath, "mysql error log path") + utils.SetFlagStringVar(fs, &flagSlowLogPath, "mycnf-slow-log-path", flagSlowLogPath, "mysql slow query log path") + utils.SetFlagStringVar(fs, &flagRelayLogPath, "mycnf-relay-log-path", flagRelayLogPath, "mysql relay log path") + utils.SetFlagStringVar(fs, &flagRelayLogIndexPath, "mycnf-relay-log-index-path", flagRelayLogIndexPath, "mysql relay log index path") + utils.SetFlagStringVar(fs, &flagRelayLogInfoPath, "mycnf-relay-log-info-path", flagRelayLogInfoPath, "mysql relay log info path") + utils.SetFlagStringVar(fs, &flagBinLogPath, "mycnf-bin-log-path", flagBinLogPath, "mysql binlog path") + utils.SetFlagStringVar(fs, &flagMasterInfoFile, "mycnf-master-info-file", flagMasterInfoFile, "mysql master.info file") + utils.SetFlagStringVar(fs, &flagPidFile, "mycnf-pid-file", flagPidFile, "mysql pid file") + utils.SetFlagStringVar(fs, &flagTmpDir, "mycnf-tmp-dir", flagTmpDir, "mysql tmp directory") + utils.SetFlagStringVar(fs, &flagSecureFilePriv, "mycnf-secure-file-priv", flagSecureFilePriv, "mysql path for loading secure files") fs.StringVar(&flagMycnfFile, "mycnf-file", flagMycnfFile, "path to my.cnf, if reading all config params from there") }) @@ -87,12 +88,12 @@ func RegisterFlags() { // NewMycnfFromFlags creates a Mycnf object from the command line flags. // // Multiple modes are supported: -// - at least mycnf_server_id is set on the command line +// - at least mycnf-server-id is set on the command line // --> then we read all parameters from the command line, and not from // any my.cnf file. -// - mycnf_server_id is not passed in, but mycnf-file is passed in +// - mycnf-server-id is not passed in, but mycnf-file is passed in // --> then we read that mycnf file -// - mycnf_server_id and mycnf-file are not passed in: +// - mycnf-server-id and mycnf-file are not passed in: // --> then we use the default location of the my.cnf file for the // provided uid and read that my.cnf file. // @@ -100,7 +101,7 @@ func RegisterFlags() { // this, otherwise we'll panic. func NewMycnfFromFlags(uid uint32) (mycnf *Mycnf, err error) { if flagServerID != 0 { - log.Info("mycnf_server_id is specified, using command line parameters for mysql config") + log.Info("mycnf-server-id is specified, using command line parameters for mysql config") return &Mycnf{ ServerID: uint32(flagServerID), MysqlPort: flagMysqlPort, @@ -129,9 +130,9 @@ func NewMycnfFromFlags(uid uint32) (mycnf *Mycnf, err error) { if flagMycnfFile == "" { flagMycnfFile = MycnfFile(uid) - log.Infof("No mycnf_server_id, no mycnf-file specified, using default config for server id %v: %v", uid, flagMycnfFile) + log.Infof("No mycnf-server-id, no mycnf-file specified, using default config for server id %v: %v", uid, flagMycnfFile) } else { - log.Infof("No mycnf_server_id specified, using mycnf-file file %v", flagMycnfFile) + log.Infof("No mycnf-server-id specified, using mycnf-file file %v", flagMycnfFile) } mycnf = NewMycnf(uid, 0) mycnf.Path = flagMycnfFile diff --git a/go/vt/mysqlctl/mysqld.go b/go/vt/mysqlctl/mysqld.go index 9dc66392779..6470a20eac9 100644 --- a/go/vt/mysqlctl/mysqld.go +++ b/go/vt/mysqlctl/mysqld.go @@ -60,6 +60,7 @@ import ( mysqlctlpb "vitess.io/vitess/go/vt/proto/mysqlctl" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" ) @@ -142,10 +143,10 @@ func init() { } func registerMySQLDFlags(fs *pflag.FlagSet) { - fs.DurationVar(&PoolDynamicHostnameResolution, "pool_hostname_resolve_interval", PoolDynamicHostnameResolution, "if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)") + utils.SetFlagDurationVar(fs, &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.") + utils.SetFlagDurationVar(fs, &replicationConnectRetry, "replication-connect-retry", replicationConnectRetry, "how long to wait in between replica reconnect attempts. Only precise to the second.") } func registerReparentFlags(fs *pflag.FlagSet) { diff --git a/go/vt/mysqlctl/s3backupstorage/README.txt b/go/vt/mysqlctl/s3backupstorage/README.txt index 53f0cf996da..bc0e567ccf7 100644 --- a/go/vt/mysqlctl/s3backupstorage/README.txt +++ b/go/vt/mysqlctl/s3backupstorage/README.txt @@ -1,8 +1,8 @@ Recently added options to enable usage of an S3 appliance: Cloudian HyperStore: - --s3_backup_aws_endpoint (port is required) - --s3_backup_force_path_style=true/false - --s3_backup_log_level can be one of: LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. Default: LogOff + --s3-backup-aws-endpoint (port is required) + --s3-backup-force-path-style=true/false + --s3-backup-log-level can be one of: LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors. Default: LogOff By default the s3 client will try to connect to ..amazonaws.com. Adjusting the endpoint will allow this @@ -10,7 +10,7 @@ to be changed. Given the way the FQDN is configured the TLS certificate may not match the server's "base" (.) due to the leading -so setting --s3_backup_force_path_style=true will force the s3 client to +so setting --s3-backup-force-path-style=true will force the s3 client to connect to . and then make a request using the full path within the http calls. diff --git a/go/vt/mysqlctl/s3backupstorage/s3.go b/go/vt/mysqlctl/s3backupstorage/s3.go index 4dd583009aa..84f3ac1d772 100644 --- a/go/vt/mysqlctl/s3backupstorage/s3.go +++ b/go/vt/mysqlctl/s3backupstorage/s3.go @@ -51,6 +51,7 @@ import ( "github.com/spf13/pflag" errorsbackup "vitess.io/vitess/go/vt/mysqlctl/errors" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/log" stats "vitess.io/vitess/go/vt/mysqlctl/backupstats" @@ -100,16 +101,17 @@ var ( ) func registerFlags(fs *pflag.FlagSet) { - fs.StringVar(®ion, "s3_backup_aws_region", "us-east-1", "AWS region to use.") - fs.IntVar(&retryCount, "s3_backup_aws_retries", -1, "AWS request retries.") - fs.StringVar(&endpoint, "s3_backup_aws_endpoint", "", "endpoint of the S3 backend (region must be provided).") - fs.StringVar(&bucket, "s3_backup_storage_bucket", "", "S3 bucket to use for backups.") - fs.StringVar(&root, "s3_backup_storage_root", "", "root prefix for all backup-related object names.") - fs.BoolVar(&forcePath, "s3_backup_force_path_style", false, "force the s3 path style.") - fs.BoolVar(&tlsSkipVerifyCert, "s3_backup_tls_skip_verify_cert", false, "skip the 'certificate is valid' check for SSL connections.") - fs.StringVar(&requiredLogLevel, "s3_backup_log_level", "LogOff", "determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors.") - fs.StringVar(&sse, "s3_backup_server_side_encryption", "", "server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file).") - fs.Int64Var(&minPartSize, "s3_backup_aws_min_partsize", manager.MinUploadPartSize, "Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size.") + + utils.SetFlagStringVar(fs, ®ion, "s3-backup-aws-region", "us-east-1", "AWS region to use.") + utils.SetFlagIntVar(fs, &retryCount, "s3-backup-aws-retries", -1, "AWS request retries.") + utils.SetFlagStringVar(fs, &endpoint, "s3-backup-aws-endpoint", "", "endpoint of the S3 backend (region must be provided).") + utils.SetFlagStringVar(fs, &bucket, "s3-backup-storage-bucket", "", "S3 bucket to use for backups.") + utils.SetFlagStringVar(fs, &root, "s3-backup-storage-root", "", "root prefix for all backup-related object names.") + utils.SetFlagBoolVar(fs, &forcePath, "s3-backup-force-path-style", false, "force the s3 path style.") + utils.SetFlagBoolVar(fs, &tlsSkipVerifyCert, "s3-backup-tls-skip-verify-cert", false, "skip the 'certificate is valid' check for SSL connections.") + utils.SetFlagStringVar(fs, &requiredLogLevel, "s3-backup-log-level", "LogOff", "determine the S3 loglevel to use from LogOff, LogDebug, LogDebugWithSigning, LogDebugWithHTTPBody, LogDebugWithRequestRetries, LogDebugWithRequestErrors.") + utils.SetFlagStringVar(fs, &sse, "s3-backup-server-side-encryption", "", "server-side encryption algorithm (e.g., AES256, aws:kms, sse_c:/path/to/key/file).") + utils.SetFlagInt64Var(fs, &minPartSize, "s3-backup-aws-min-partsize", manager.MinUploadPartSize, "Minimum part size to use, defaults to 5MiB but can be increased due to the dataset size.") } func init() { @@ -550,7 +552,7 @@ func (bs *S3BackupStorage) client() (*s3.Client, error) { bs._client = s3.NewFromConfig(cfg, options...) if len(bucket) == 0 { - return nil, fmt.Errorf("--s3_backup_storage_bucket required") + return nil, fmt.Errorf("--s3-backup-storage-bucket required") } if _, err := bs._client.HeadBucket(context.Background(), &s3.HeadBucketInput{Bucket: &bucket}); err != nil { diff --git a/go/vt/mysqlctl/xtrabackupengine.go b/go/vt/mysqlctl/xtrabackupengine.go index 32d54a19a4b..937d4a4b3e1 100644 --- a/go/vt/mysqlctl/xtrabackupengine.go +++ b/go/vt/mysqlctl/xtrabackupengine.go @@ -39,6 +39,7 @@ import ( tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" ) @@ -126,14 +127,14 @@ func init() { } 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. 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") + utils.SetFlagStringVar(fs, &xtrabackupEnginePath, "xtrabackup-root-path", xtrabackupEnginePath, "Directory location of the xtrabackup and xbstream executables, e.g., /usr/bin") + utils.SetFlagStringVar(fs, &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") + utils.SetFlagStringVar(fs, &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") + utils.SetFlagStringVar(fs, &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") + utils.SetFlagStringVar(fs, &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.") + utils.SetFlagUintVar(fs, &xtrabackupStripes, "xtrabackup-stripes", xtrabackupStripes, "If greater than 0, use data striping across this many destination files to parallelize data transfer and decompression") + utils.SetFlagUintVar(fs, &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") } func (be *XtrabackupEngine) backupFileName() string { @@ -740,7 +741,7 @@ func (be *XtrabackupEngine) extractFiles(ctx context.Context, logger logutil.Log return vterrors.Wrap(err, "xbstream failed") } default: - return vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "%v is not a valid value for xtrabackup_stream_mode, supported modes are tar and xbstream", streamMode) + return vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "%v is not a valid value for xtrabackup-stream-mode, supported modes are tar and xbstream", streamMode) } return nil } diff --git a/go/vt/srvtopo/resilient_server.go b/go/vt/srvtopo/resilient_server.go index 78fc9134bce..1b8b390f087 100644 --- a/go/vt/srvtopo/resilient_server.go +++ b/go/vt/srvtopo/resilient_server.go @@ -26,6 +26,7 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -33,23 +34,23 @@ var ( // the caching for both watched and unwatched values. // // For entries we don't watch (like the list of Keyspaces), we refresh - // the cached list from the topo after srv_topo_cache_refresh elapses. + // the cached list from the topo after srv-topo-cache-refresh elapses. // If the fetch fails, we hold onto the cached value until - // srv_topo_cache_ttl elapses. + // srv-topo-cache-ttl elapses. // // For entries we watch (like the SrvKeyspace for a given cell), if // setting the watch fails, we will use the last known value until - // srv_topo_cache_ttl elapses and we only try to re-establish the watch - // once every srv_topo_cache_refresh interval. + // srv-topo-cache-ttl elapses and we only try to re-establish the watch + // once every srv-topo-cache-refresh interval. srvTopoTimeout = 5 * time.Second srvTopoCacheTTL = 1 * time.Second srvTopoCacheRefresh = 1 * time.Second ) func registerFlags(fs *pflag.FlagSet) { - fs.DurationVar(&srvTopoTimeout, "srv_topo_timeout", srvTopoTimeout, "topo server timeout") - fs.DurationVar(&srvTopoCacheTTL, "srv_topo_cache_ttl", srvTopoCacheTTL, "how long to use cached entries for topology") - fs.DurationVar(&srvTopoCacheRefresh, "srv_topo_cache_refresh", srvTopoCacheRefresh, "how frequently to refresh the topology for cached entries") + utils.SetFlagDurationVar(fs, &srvTopoTimeout, "srv-topo-timeout", srvTopoTimeout, "topo server timeout") + utils.SetFlagDurationVar(fs, &srvTopoCacheTTL, "srv-topo-cache-ttl", srvTopoCacheTTL, "how long to use cached entries for topology") + utils.SetFlagDurationVar(fs, &srvTopoCacheRefresh, "srv-topo-cache-refresh", srvTopoCacheRefresh, "how frequently to refresh the topology for cached entries") } func init() { @@ -80,7 +81,7 @@ type ResilientServer struct { // based on the provided topo.Server. func NewResilientServer(ctx context.Context, base *topo.Server, counts *stats.CountersWithSingleLabel) *ResilientServer { if srvTopoCacheRefresh > srvTopoCacheTTL { - log.Fatalf("srv_topo_cache_refresh must be less than or equal to srv_topo_cache_ttl") + log.Fatalf("srv-topo-cache-refresh must be less than or equal to srv-topo-cache-ttl") } return &ResilientServer{ diff --git a/go/vt/topo/consultopo/server.go b/go/vt/topo/consultopo/server.go index d207a0a104b..b0f096726a7 100644 --- a/go/vt/topo/consultopo/server.go +++ b/go/vt/topo/consultopo/server.go @@ -49,7 +49,7 @@ func init() { } func registerServerFlags(fs *pflag.FlagSet) { - fs.StringVar(&consulAuthClientStaticFile, "consul_auth_static_file", consulAuthClientStaticFile, "JSON File to read the topos/tokens from.") + utils.SetFlagStringVar(fs, &consulAuthClientStaticFile, "consul-auth-static-file", consulAuthClientStaticFile, "JSON File to read the topos/tokens from.") utils.SetFlagStringVar(fs, &consulLockSessionChecks, "topo-consul-lock-session-checks", consulLockSessionChecks, "List of checks for consul session.") utils.SetFlagStringVar(fs, &consulLockSessionTTL, "topo-consul-lock-session-ttl", consulLockSessionTTL, "TTL for consul session.") utils.SetFlagDurationVar(fs, &consulLockDelay, "topo-consul-lock-delay", consulLockDelay, "LockDelay for consul session.") @@ -79,18 +79,18 @@ func getClientCreds() (creds map[string]*ClientAuthCred, err error) { if consulAuthClientStaticFile == "" { // Not configured, nothing to do. - log.Infof("Consul client auth is not set up. consul_auth_static_file was not provided") + log.Infof("Consul client auth is not set up. consul-auth-static-file was not provided") return nil, nil } data, err := os.ReadFile(consulAuthClientStaticFile) if err != nil { - err = vterrors.Wrapf(err, "Failed to read consul_auth_static_file file") + err = vterrors.Wrapf(err, "Failed to read consul-auth-static-file file") return creds, err } if err := json.Unmarshal(data, &creds); err != nil { - err = vterrors.Wrapf(err, "Error parsing consul_auth_static_file") + err = vterrors.Wrapf(err, "Error parsing consul-auth-static-file") return creds, err } return creds, nil diff --git a/go/vt/topo/locks.go b/go/vt/topo/locks.go index 1d6bb949ca9..b2a3957d116 100644 --- a/go/vt/topo/locks.go +++ b/go/vt/topo/locks.go @@ -31,6 +31,7 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" ) @@ -73,7 +74,7 @@ func init() { } func registerTopoLockFlags(fs *pflag.FlagSet) { - fs.DurationVar(&RemoteOperationTimeout, "remote_operation_timeout", RemoteOperationTimeout, "time to wait for a remote operation") + utils.SetFlagDurationVar(fs, &RemoteOperationTimeout, "remote-operation-timeout", RemoteOperationTimeout, "time to wait for a remote operation") fs.DurationVar(&LockTimeout, "lock-timeout", LockTimeout, "Maximum time to wait when attempting to acquire a lock from the topo server") } diff --git a/go/vt/utils/flags.go b/go/vt/utils/flags.go index 978e4365e74..460fc5f8510 100644 --- a/go/vt/utils/flags.go +++ b/go/vt/utils/flags.go @@ -81,6 +81,10 @@ func SetFlagDurationVar(fs *pflag.FlagSet, p *time.Duration, name string, def ti setFlagVar(fs, p, name, def, usage, (*pflag.FlagSet).DurationVar) } +func SetFlagUint32Var(fs *pflag.FlagSet, p *uint32, name string, def uint32, usage string) { + setFlagVar(fs, p, name, def, usage, (*pflag.FlagSet).Uint32Var) +} + func SetFlagUint64Var(fs *pflag.FlagSet, p *uint64, name string, def uint64, usage string) { setFlagVar(fs, p, name, def, usage, (*pflag.FlagSet).Uint64Var) } @@ -89,6 +93,10 @@ func SetFlagStringSliceVar(fs *pflag.FlagSet, p *[]string, name string, def []st setFlagVar(fs, p, name, def, usage, (*pflag.FlagSet).StringSliceVar) } +func SetFlagUintVar(fs *pflag.FlagSet, p *uint, name string, def uint, usage string) { + setFlagVar(fs, p, name, def, usage, (*pflag.FlagSet).UintVar) +} + // SetFlagVar registers a flag (that implements the pflag.Value interface) // using both the dashed and underscored versions of the flag name. // The underscored version is hidden and marked as deprecated. diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index 6aeea294e35..f8086fefc32 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -223,7 +223,7 @@ func InitTabletMap( return 0, fmt.Errorf("RebuildVSchemaGraph failed: %v", err) } - // Register the tablet dialer for tablet server. main() forces the --tablet_protocol + // Register the tablet dialer for tablet server. main() forces the --tablet-protocol // flag to this value. tabletconn.RegisterDialer("internal", dialer) diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index 43e4d1b853d..950ce6652b4 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -174,7 +174,7 @@ var commands = []commandGroup{ { name: "InitTablet", method: commandInitTablet, - params: "[--allow_update] [--allow_different_shard] [--allow_master_override] [--parent] [--db_name_override=] [--hostname=] [--mysql_port=] [--port=] [--grpc-port=] [--tags=tag1:value1,tag2:value2] --keyspace= --shard= ", + params: "[--allow_update] [--allow_different_shard] [--allow_master_override] [--parent] [--db_name_override=] [--hostname=] [--mysql-port=] [--port=] [--grpc-port=] [--tags=tag1:value1,tag2:value2] --keyspace= --shard= ", help: "Initializes a tablet in the topology.", deprecated: true, }, @@ -918,7 +918,7 @@ func commandInitTablet(ctx context.Context, wr *wrangler.Wrangler, subFlags *pfl createShardAndKeyspace := subFlags.Bool("parent", false, "Creates the parent shard and keyspace if they don't yet exist") hostname := subFlags.String("hostname", "", "The server on which the tablet is running") mysqlHost := subFlags.String("mysql_host", "", "The mysql host for the mysql server") - mysqlPort := subFlags.Int("mysql_port", 0, "The mysql port for the mysql server") + mysqlPort := subFlags.Int("mysql-port", 0, "The mysql port for the mysql server") port := subFlags.Int("port", 0, "The main port for the vttablet process") grpcPort := subFlags.Int("grpc-port", 0, "The gRPC port for the vttablet process") keyspace := subFlags.String("keyspace", "", "The keyspace to which this tablet belongs") diff --git a/go/vt/vtgate/plugin_mysql_server.go b/go/vt/vtgate/plugin_mysql_server.go index ef01ec7a301..2f7abd9e86a 100644 --- a/go/vt/vtgate/plugin_mysql_server.go +++ b/go/vt/vtgate/plugin_mysql_server.go @@ -45,6 +45,7 @@ import ( vtgatepb "vitess.io/vitess/go/vt/proto/vtgate" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtenv" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vttls" @@ -81,11 +82,11 @@ var ( ) func registerPluginFlags(fs *pflag.FlagSet) { - fs.IntVar(&mysqlServerPort, "mysql_server_port", mysqlServerPort, "If set, also listen for MySQL binary protocol connections on this port.") + utils.SetFlagIntVar(fs, &mysqlServerPort, "mysql-server-port", mysqlServerPort, "If set, also listen for MySQL binary protocol connections on this port.") fs.StringVar(&mysqlServerBindAddress, "mysql_server_bind_address", mysqlServerBindAddress, "Binds on this address when listening to MySQL binary protocol. Useful to restrict listening to 'localhost' only for instance.") fs.StringVar(&mysqlServerSocketPath, "mysql_server_socket_path", mysqlServerSocketPath, "This option specifies the Unix socket file to use when listening for local connections. By default it will be empty and it won't listen to a unix socket") fs.StringVar(&mysqlTCPVersion, "mysql_tcp_version", mysqlTCPVersion, "Select tcp, tcp4, or tcp6 to control the socket type.") - fs.StringVar(&mysqlAuthServerImpl, "mysql_auth_server_impl", mysqlAuthServerImpl, "Which auth server implementation to use. Options: none, ldap, clientcert, static, vault.") + utils.SetFlagStringVar(fs, &mysqlAuthServerImpl, "mysql-auth-server-impl", mysqlAuthServerImpl, "Which auth server implementation to use. Options: none, ldap, clientcert, static, vault.") fs.BoolVar(&mysqlAllowClearTextWithoutTLS, "mysql_allow_clear_text_without_tls", mysqlAllowClearTextWithoutTLS, "If set, the server will allow the use of a clear text password over non-SSL connections.") fs.BoolVar(&mysqlProxyProtocol, "proxy_protocol", mysqlProxyProtocol, "Enable HAProxy PROXY protocol on MySQL listener socket") fs.BoolVar(&mysqlServerRequireSecureTransport, "mysql_server_require_secure_transport", mysqlServerRequireSecureTransport, "Reject insecure connections but only if mysql_server_ssl_cert and mysql_server_ssl_key are provided") diff --git a/go/vt/vttablet/grpctabletconn/conn.go b/go/vt/vttablet/grpctabletconn/conn.go index d2d5604d808..0ef94031cf3 100644 --- a/go/vt/vttablet/grpctabletconn/conn.go +++ b/go/vt/vttablet/grpctabletconn/conn.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/vt/callerid" "vitess.io/vitess/go/vt/grpcclient" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vttablet/queryservice" "vitess.io/vitess/go/vt/vttablet/tabletconn" @@ -49,11 +50,11 @@ var ( ) func registerFlags(fs *pflag.FlagSet) { - fs.StringVar(&cert, "tablet_grpc_cert", cert, "the cert to use to connect") - fs.StringVar(&key, "tablet_grpc_key", key, "the key to use to connect") - fs.StringVar(&ca, "tablet_grpc_ca", ca, "the server ca to use to validate servers when connecting") - fs.StringVar(&crl, "tablet_grpc_crl", crl, "the server crl to use to validate server certificates when connecting") - fs.StringVar(&name, "tablet_grpc_server_name", name, "the server name to use to validate server certificate") + utils.SetFlagStringVar(fs, &cert, "tablet-grpc-cert", cert, "the cert to use to connect") + utils.SetFlagStringVar(fs, &key, "tablet-grpc-key", key, "the key to use to connect") + utils.SetFlagStringVar(fs, &ca, "tablet-grpc-ca", ca, "the server ca to use to validate servers when connecting") + utils.SetFlagStringVar(fs, &crl, "tablet-grpc-crl", crl, "the server crl to use to validate server certificates when connecting") + utils.SetFlagStringVar(fs, &name, "tablet-grpc-server-name", name, "the server name to use to validate server certificate") } func init() { diff --git a/go/vt/vttablet/tabletconn/tablet_conn.go b/go/vt/vttablet/tabletconn/tablet_conn.go index 1ed806bcc53..8c2c233dd45 100644 --- a/go/vt/vttablet/tabletconn/tablet_conn.go +++ b/go/vt/vttablet/tabletconn/tablet_conn.go @@ -25,6 +25,7 @@ import ( "vitess.io/vitess/go/vt/grpcclient" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vttablet/queryservice" @@ -42,7 +43,7 @@ var ( // RegisterFlags registers the tabletconn flags on a given flagset. It is // exported for tests that need to inject a particular TabletProtocol. func RegisterFlags(fs *pflag.FlagSet) { - fs.StringVar(&tabletProtocol, "tablet_protocol", "grpc", "Protocol to use to make queryservice RPCs to vttablets.") + utils.SetFlagStringVar(fs, &tabletProtocol, "tablet-protocol", "grpc", "Protocol to use to make queryservice RPCs to vttablets.") } func init() { diff --git a/go/vt/vttablet/tabletconntest/tabletconntest.go b/go/vt/vttablet/tabletconntest/tabletconntest.go index aa160756ef4..91aeceb0dcd 100644 --- a/go/vt/vttablet/tabletconntest/tabletconntest.go +++ b/go/vt/vttablet/tabletconntest/tabletconntest.go @@ -1064,9 +1064,9 @@ func TestSuite(ctx context.Context, t *testing.T, protocol string, tablet *topod conn.Close(context.Background()) } -const tabletProtocolFlagName = "tablet_protocol" +const tabletProtocolFlagName = "tablet-protocol" -// SetProtocol is a helper function to set the tabletconn --tablet_protocol flag +// SetProtocol is a helper function to set the tabletconn --tablet-protocol flag // value for tests. // // Note that because this variable is bound to a flag, the effects of this diff --git a/go/vt/vttablet/tabletmanager/restore.go b/go/vt/vttablet/tabletmanager/restore.go index 54813e11bf3..4766f877f38 100644 --- a/go/vt/vttablet/tabletmanager/restore.go +++ b/go/vt/vttablet/tabletmanager/restore.go @@ -303,7 +303,7 @@ func (tm *TabletManager) restoreDataLocked(ctx context.Context, logger logutil.L return vterrors.Wrap(err, "Can't restore backup") } - // If we had type BACKUP or RESTORE it's better to set our type to the init_tablet_type to make result of the restore + // If we had type BACKUP or RESTORE it's better to set our type to the init-tablet-type to make result of the restore // similar to completely clean start from scratch. if (originalType == topodatapb.TabletType_BACKUP || originalType == topodatapb.TabletType_RESTORE) && initTabletType != "" { initType, err := topoproto.ParseTabletType(initTabletType) diff --git a/go/vt/vttablet/tabletmanager/tm_init.go b/go/vt/vttablet/tabletmanager/tm_init.go index 4c7b706bc4b..5cd4ab37fc6 100644 --- a/go/vt/vttablet/tabletmanager/tm_init.go +++ b/go/vt/vttablet/tabletmanager/tm_init.go @@ -70,6 +70,7 @@ import ( "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/topotools" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" "vitess.io/vitess/go/vt/vtenv" "vitess.io/vitess/go/vt/vterrors" @@ -101,13 +102,13 @@ var ( ) func registerInitFlags(fs *pflag.FlagSet) { - fs.StringVar(&tabletHostname, "tablet_hostname", tabletHostname, "if not empty, this hostname will be assumed instead of trying to resolve it") - fs.StringVar(&initKeyspace, "init_keyspace", initKeyspace, "(init parameter) keyspace to use for this tablet") - fs.StringVar(&initShard, "init_shard", initShard, "(init parameter) shard to use for this tablet") - fs.StringVar(&initTabletType, "init_tablet_type", initTabletType, "(init parameter) the tablet type to use for this tablet.") - fs.StringVar(&initDbNameOverride, "init_db_name_override", initDbNameOverride, "(init parameter) override the name of the db used by vttablet. Without this flag, the db name defaults to vt_") - fs.StringVar(&skipBuildInfoTags, "vttablet_skip_buildinfo_tags", skipBuildInfoTags, "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/'.") - fs.Var(&initTags, "init_tags", "(init parameter) comma separated list of key:value pairs used to tag the tablet") + utils.SetFlagStringVar(fs, &tabletHostname, "tablet-hostname", tabletHostname, "if not empty, this hostname will be assumed instead of trying to resolve it") + utils.SetFlagStringVar(fs, &initKeyspace, "init-keyspace", initKeyspace, "(init parameter) keyspace to use for this tablet") + utils.SetFlagStringVar(fs, &initShard, "init-shard", initShard, "(init parameter) shard to use for this tablet") + utils.SetFlagStringVar(fs, &initTabletType, "init-tablet-type", initTabletType, "(init parameter) tablet type to use for this tablet. Valid values are: PRIMARY, REPLICA, SPARE, and RDONLY. The default is REPLICA.") + utils.SetFlagStringVar(fs, &initDbNameOverride, "init-db-name-override", initDbNameOverride, "(init parameter) override the name of the db used by vttablet. Without this flag, the db name defaults to vt_") + fs.StringVar(&skipBuildInfoTags, "vttablet_skip_buildinfo_tags", skipBuildInfoTags, "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/'.") + utils.SetFlagVar(fs, &initTags, "init-tags", "(init parameter) comma separated list of key:value pairs used to tag the tablet") fs.DurationVar(&initTimeout, "init_timeout", initTimeout, "(init parameter) timeout to use for the init phase.") fs.DurationVar(&mysqlShutdownTimeout, "mysql-shutdown-timeout", mysqlShutdownTimeout, "timeout to use when MySQL is being shut down.") } @@ -232,13 +233,13 @@ func BuildTabletFromInput(alias *topodatapb.TabletAlias, port, grpcPort int32, d if err != nil { return nil, err } - log.Infof("Using detected machine hostname: %v, to change this, fix your machine network configuration or override it with --tablet_hostname. Tablet %s", hostname, alias.String()) + log.Infof("Using detected machine hostname: %v, to change this, fix your machine network configuration or override it with --tablet-hostname. Tablet %s", hostname, alias.String()) } else { - log.Infof("Using hostname: %v from --tablet_hostname flag. Tablet %s", hostname, alias.String()) + log.Infof("Using hostname: %v from --tablet-hostname flag. Tablet %s", hostname, alias.String()) } if initKeyspace == "" || initShard == "" { - return nil, fmt.Errorf("init_keyspace and init_shard must be specified") + return nil, fmt.Errorf("init-keyspace and init-shard must be specified") } // parse and validate shard name @@ -254,7 +255,7 @@ func BuildTabletFromInput(alias *topodatapb.TabletAlias, port, grpcPort int32, d switch tabletType { case topodatapb.TabletType_SPARE, topodatapb.TabletType_REPLICA, topodatapb.TabletType_RDONLY: default: - return nil, fmt.Errorf("invalid init_tablet_type %v; can only be REPLICA, RDONLY or SPARE", tabletType) + return nil, fmt.Errorf("invalid init-tablet-type %v; can only be REPLICA, RDONLY or SPARE", tabletType) } buildTags, err := getBuildTags(servenv.AppVersion.ToStringMap(), skipBuildInfoTags) diff --git a/go/vt/vttablet/tabletmanager/tm_init_test.go b/go/vt/vttablet/tabletmanager/tm_init_test.go index a6c5d33c975..3d8b9fd132f 100644 --- a/go/vt/vttablet/tabletmanager/tm_init_test.go +++ b/go/vt/vttablet/tabletmanager/tm_init_test.go @@ -107,12 +107,12 @@ func TestStartBuildTabletFromInput(t *testing.T) { initKeyspace = "" initShard = "0" _, err = BuildTabletFromInput(alias, port, grpcport, nil, collations.MySQL8()) - assert.Contains(t, err.Error(), "init_keyspace and init_shard must be specified") + assert.Contains(t, err.Error(), "init-keyspace and init-shard must be specified") initKeyspace = "test_keyspace" initShard = "" _, err = BuildTabletFromInput(alias, port, grpcport, nil, collations.MySQL8()) - assert.Contains(t, err.Error(), "init_keyspace and init_shard must be specified") + assert.Contains(t, err.Error(), "init-keyspace and init-shard must be specified") initShard = "x-y" _, err = BuildTabletFromInput(alias, port, grpcport, nil, collations.MySQL8()) @@ -125,7 +125,7 @@ func TestStartBuildTabletFromInput(t *testing.T) { initTabletType = "primary" _, err = BuildTabletFromInput(alias, port, grpcport, nil, collations.MySQL8()) - assert.Contains(t, err.Error(), "invalid init_tablet_type PRIMARY") + assert.Contains(t, err.Error(), "invalid init-tablet-type PRIMARY") } func TestBuildTabletFromInputWithBuildTags(t *testing.T) { diff --git a/go/vt/vttablet/tabletserver/tabletenv/config.go b/go/vt/vttablet/tabletserver/tabletenv/config.go index 47a9acfc930..84b9444c3cc 100644 --- a/go/vt/vttablet/tabletserver/tabletenv/config.go +++ b/go/vt/vttablet/tabletserver/tabletenv/config.go @@ -37,6 +37,7 @@ import ( "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/throttler" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" querypb "vitess.io/vitess/go/vt/proto/query" @@ -189,8 +190,8 @@ func registerTabletEnvFlags(fs *pflag.FlagSet) { fs.BoolVar(¤tConfig.TransactionLimitByComponent, "transaction_limit_by_component", defaultConfig.TransactionLimitByComponent, "Include CallerID.component when considering who the user is for the purpose of transaction limit.") fs.BoolVar(¤tConfig.TransactionLimitBySubcomponent, "transaction_limit_by_subcomponent", defaultConfig.TransactionLimitBySubcomponent, "Include CallerID.subcomponent when considering who the user is for the purpose of transaction limit.") - fs.BoolVar(&enableHeartbeat, "heartbeat_enable", false, "If true, vttablet records (if master) or checks (if replica) the current time of a replication heartbeat in the sidecar database's heartbeat table. The result is used to inform the serving state of the vttablet via healthchecks.") - fs.DurationVar(&heartbeatInterval, "heartbeat_interval", 1*time.Second, "How frequently to read and write replication heartbeat.") + utils.SetFlagBoolVar(fs, &enableHeartbeat, "heartbeat-enable", false, "If true, vttablet records (if master) or checks (if replica) the current time of a replication heartbeat in the sidecar database's heartbeat table. The result is used to inform the serving state of the vttablet via healthchecks.") + utils.SetFlagDurationVar(fs, &heartbeatInterval, "heartbeat-interval", 1*time.Second, "How frequently to read and write replication heartbeat.") fs.DurationVar(&heartbeatOnDemandDuration, "heartbeat_on_demand_duration", 0, "If non-zero, heartbeats are only written upon consumer request, and only run for up to given duration following the request. Frequent requests can keep the heartbeat running consistently; when requests are infrequent heartbeat may completely stop between requests") fs.BoolVar(¤tConfig.EnforceStrictTransTables, "enforce_strict_trans_tables", defaultConfig.EnforceStrictTransTables, "If true, vttablet requires MySQL to run with STRICT_TRANS_TABLES or STRICT_ALL_TABLES on. It is recommended to not turn this flag off. Otherwise MySQL may alter your supplied values before saving them to the database.") diff --git a/go/vt/vttest/local_cluster.go b/go/vt/vttest/local_cluster.go index eb2872ef49b..82e876476c5 100644 --- a/go/vt/vttest/local_cluster.go +++ b/go/vt/vttest/local_cluster.go @@ -106,7 +106,7 @@ type Config struct { // when LocalCluster.TearDown() is called. This is useful for running // vttestserver as a database container in local developer environments. Note // that db and vschema migration files (-schema_dir option) and seeding of - // random data (-initialize_with_random_data option) will only run during + // random data (-initialize-with-random-data option) will only run during // cluster startup if the data directory does not already exist. PersistentMode bool diff --git a/go/vt/vttest/mysqlctl.go b/go/vt/vttest/mysqlctl.go index d8df6c99d48..751da56f3d8 100644 --- a/go/vt/vttest/mysqlctl.go +++ b/go/vt/vttest/mysqlctl.go @@ -64,8 +64,8 @@ func (ctl *Mysqlctl) Setup() error { cmd := exec.CommandContext(ctx, ctl.Binary, "--alsologtostderr", - "--tablet_uid", fmt.Sprintf("%d", ctl.UID), - "--mysql_port", fmt.Sprintf("%d", ctl.Port), + "--tablet-uid", fmt.Sprintf("%d", ctl.UID), + "--mysql-port", fmt.Sprintf("%d", ctl.Port), "init", "--init_db_sql_file", ctl.InitFile, ) @@ -89,8 +89,8 @@ func (ctl *Mysqlctl) Start() error { cmd := exec.CommandContext(ctx, ctl.Binary, "--alsologtostderr", - "--tablet_uid", fmt.Sprintf("%d", ctl.UID), - "--mysql_port", fmt.Sprintf("%d", ctl.Port), + "--tablet-uid", fmt.Sprintf("%d", ctl.UID), + "--mysql-port", fmt.Sprintf("%d", ctl.Port), "start", ) @@ -112,8 +112,8 @@ func (ctl *Mysqlctl) TearDown() error { cmd := exec.CommandContext(ctx, ctl.Binary, "--alsologtostderr", - "--tablet_uid", fmt.Sprintf("%d", ctl.UID), - "--mysql_port", fmt.Sprintf("%d", ctl.Port), + "--tablet-uid", fmt.Sprintf("%d", ctl.UID), + "--mysql-port", fmt.Sprintf("%d", ctl.Port), "shutdown", ) diff --git a/go/vt/vttest/vtprocess.go b/go/vt/vttest/vtprocess.go index b3861a9583a..a8236871f48 100644 --- a/go/vt/vttest/vtprocess.go +++ b/go/vt/vttest/vtprocess.go @@ -238,8 +238,8 @@ func VtcomboProcess(environment Environment, args *Config, mysql MySQLManager) ( "--db_dba_user", user, "--db_dba_password", pass, "--proto_topo", string(protoTopo), - "--mycnf_server_id", "1", - "--mycnf_socket_file", socket, + "--mycnf-server-id", "1", + "--mycnf-socket-file", socket, "--normalize_queries", "--dbddl_plugin", "vttest", "--foreign_key_mode", args.ForeignKeyMode, @@ -254,9 +254,9 @@ func VtcomboProcess(environment Environment, args *Config, mysql MySQLManager) ( // that the default value is 1 minute, but we are keeping it low to make vttestserver perform faster. // Less value might result in high pressure on topo but for testing purpose that should not be a concern. if args.VtgateTabletRefreshInterval <= 0 { - vt.ExtraArgs = append(vt.ExtraArgs, fmt.Sprintf("--tablet_refresh_interval=%v", 10*time.Second)) + vt.ExtraArgs = append(vt.ExtraArgs, fmt.Sprintf("--tablet-refresh-interval=%v", 10*time.Second)) } else { - vt.ExtraArgs = append(vt.ExtraArgs, fmt.Sprintf("--tablet_refresh_interval=%v", args.VtgateTabletRefreshInterval)) + vt.ExtraArgs = append(vt.ExtraArgs, fmt.Sprintf("--tablet-refresh-interval=%v", args.VtgateTabletRefreshInterval)) } vt.ExtraArgs = append(vt.ExtraArgs, QueryServerArgs...) @@ -275,7 +275,7 @@ func VtcomboProcess(environment Environment, args *Config, mysql MySQLManager) ( vt.ExtraArgs = append(vt.ExtraArgs, "--queryserver-config-transaction-timeout", fmt.Sprintf("%v", args.TransactionTimeout)) } if args.TabletHostName != "" { - vt.ExtraArgs = append(vt.ExtraArgs, []string{"--tablet_hostname", args.TabletHostName}...) + vt.ExtraArgs = append(vt.ExtraArgs, []string{"--tablet-hostname", args.TabletHostName}...) } if servenv.GRPCAuth() == "mtls" { vt.ExtraArgs = append(vt.ExtraArgs, []string{"--grpc-auth-mode", servenv.GRPCAuth(), "--grpc-key", servenv.GRPCKey(), "--grpc-cert", servenv.GRPCCert(), "--grpc-ca", servenv.GRPCCertificateAuthority(), "--grpc-auth-mtls-allowed-substrings", servenv.ClientCertSubstrings()}...) @@ -305,8 +305,8 @@ func VtcomboProcess(environment Environment, args *Config, mysql MySQLManager) ( } vt.ExtraArgs = append(vt.ExtraArgs, []string{ - "--mysql_auth_server_impl", "none", - "--mysql_server_port", fmt.Sprintf("%d", vtcomboMysqlPort), + "--mysql-auth-server-impl", "none", + "--mysql-server-port", fmt.Sprintf("%d", vtcomboMysqlPort), "--mysql_server_bind_address", vtcomboMysqlBindAddress, }...)