diff --git a/.gitignore b/.gitignore index e8c441d3bd7..088ef5bb574 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,4 @@ report # mise files .mise.toml /errors/ +go/flags/endtoend/count_flags.sh diff --git a/docker/mini/vtctld-mini-up.sh b/docker/mini/vtctld-mini-up.sh index 641763ab016..778d5e6180a 100755 --- a/docker/mini/vtctld-mini-up.sh +++ b/docker/mini/vtctld-mini-up.sh @@ -23,6 +23,7 @@ grpc_port=15999 echo "- Starting vtctld..." # shellcheck disable=SC2086 +#TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation vtctld \ $TOPOLOGY_FLAGS \ --disable_active_reparents \ diff --git a/docker/mini/vttablet-mini-up.sh b/docker/mini/vttablet-mini-up.sh index 37e74565763..288a41d44c3 100755 --- a/docker/mini/vttablet-mini-up.sh +++ b/docker/mini/vttablet-mini-up.sh @@ -39,6 +39,7 @@ echo "> Starting vttablet for server $mysql_host:$mysql_port" echo " - Tablet alias is $alias" echo " - Tablet listens on http://$hostname:$port" # shellcheck disable=SC2086 +#TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation vttablet \ $TOPOLOGY_FLAGS \ -log_dir $VTDATAROOT/tmp \ diff --git a/examples/common/scripts/vtctld-up.sh b/examples/common/scripts/vtctld-up.sh index b0e302679e0..c678826ba2a 100755 --- a/examples/common/scripts/vtctld-up.sh +++ b/examples/common/scripts/vtctld-up.sh @@ -23,6 +23,7 @@ grpc_port=15999 echo "Starting vtctld..." # shellcheck disable=SC2086 +#TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation vtctld \ $TOPOLOGY_FLAGS \ --cell $cell \ diff --git a/examples/common/scripts/vtgate-up.sh b/examples/common/scripts/vtgate-up.sh index fd7860cf6ba..a706f6bfcb5 100755 --- a/examples/common/scripts/vtgate-up.sh +++ b/examples/common/scripts/vtgate-up.sh @@ -26,6 +26,7 @@ mysql_server_socket_path="/tmp/mysql.sock" echo "Starting vtgate..." # shellcheck disable=SC2086 +#TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation vtgate \ $TOPOLOGY_FLAGS \ --log_dir $VTDATAROOT/tmp \ diff --git a/examples/compose/docker-compose.beginners.yml b/examples/compose/docker-compose.beginners.yml index bb364846df1..f17e3a74ca4 100644 --- a/examples/compose/docker-compose.beginners.yml +++ b/examples/compose/docker-compose.beginners.yml @@ -63,6 +63,7 @@ services: - "15000:$WEB_PORT" - "$GRPC_PORT" command: ["sh", "-c", " /vt/bin/vtctld \ + # TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation $TOPOLOGY_FLAGS \ --cell $CELL \ --service_map 'grpc-vtctl,grpc-vtctld' \ @@ -70,7 +71,7 @@ services: --file_backup_storage_root /vt/vtdataroot/backups \ --logtostderr=true \ --port $WEB_PORT \ - --grpc_port $GRPC_PORT + --grpc-port $GRPC_PORT "] depends_on: consul1: @@ -89,10 +90,11 @@ services: - "$GRPC_PORT" - "15306:$MYSQL_PORT" command: ["sh", "-c", "/vt/bin/vtgate \ + # TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation $TOPOLOGY_FLAGS \ --logtostderr=true \ --port $WEB_PORT \ - --grpc_port $GRPC_PORT \ + --grpc-port $GRPC_PORT \ --mysql_server_port $MYSQL_PORT \ --mysql_auth_server_impl none \ --cell $CELL \ diff --git a/examples/compose/docker-compose.yml b/examples/compose/docker-compose.yml index 8d48e67cae4..2ddfcc5b7cf 100644 --- a/examples/compose/docker-compose.yml +++ b/examples/compose/docker-compose.yml @@ -139,7 +139,7 @@ services: - ' /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 ' + /vt/vtdataroot/backups --logtostderr=true --port 8080 --grpc-port 15999 ' depends_on: external_db_host: condition: service_healthy @@ -154,7 +154,7 @@ 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 + 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 ' diff --git a/examples/compose/vtcompose/docker-compose.test.yml b/examples/compose/vtcompose/docker-compose.test.yml index a8eeda4dc69..1a6fcf98673 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 ecd95d4e0e9..092bca4fd11 100644 --- a/examples/compose/vtcompose/vtcompose.go +++ b/examples/compose/vtcompose/vtcompose.go @@ -637,7 +637,7 @@ func generateVtctld(opts vtOptions) string { --file_backup_storage_root /vt/vtdataroot/backups \ --logtostderr=true \ --port %[1]d \ - --grpc_port %[2]d \ + --grpc-port %[2]d \ "] volumes: - .:/script @@ -665,7 +665,7 @@ func generateVtgate(opts vtOptions) string { %[4]s \ --logtostderr=true \ --port %[1]d \ - --grpc_port %[2]d \ + --grpc-port %[2]d \ --mysql_server_port %[3]d \ --mysql_auth_server_impl none \ --cell %[5]s \ diff --git a/examples/compose/vttablet-up.sh b/examples/compose/vttablet-up.sh index 9e16869b1af..1c9f7720748 100755 --- a/examples/compose/vttablet-up.sh +++ b/examples/compose/vttablet-up.sh @@ -142,7 +142,7 @@ else --restore_from_backup" fi - +#TODO: Remove underscore(_) flags in v25, replace them with dashed(-) notation echo "Starting vttablet..." exec $VTROOT/bin/vttablet \ $TOPOLOGY_FLAGS \ diff --git a/go/cmd/vtadmin/main.go b/go/cmd/vtadmin/main.go index ad93d058c00..4666c968f9c 100644 --- a/go/cmd/vtadmin/main.go +++ b/go/cmd/vtadmin/main.go @@ -28,6 +28,7 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtadmin" "vitess.io/vitess/go/vt/vtadmin/cache" "vitess.io/vitess/go/vt/vtadmin/cluster" @@ -173,7 +174,7 @@ func main() { // Tracing flags trace.RegisterFlags(rootCmd.Flags()) // defined in go/vt/trace - rootCmd.Flags().BoolVar(&opts.EnableTracing, "grpc-tracing", false, "whether to enable tracing on the gRPC server") + utils.SetFlagBoolVar(rootCmd.Flags(), &opts.EnableTracing, "grpc-tracing", false, "whether to enable tracing on the gRPC server") rootCmd.Flags().BoolVar(&httpOpts.EnableTracing, "http-tracing", false, "whether to enable tracing on the HTTP server") // gRPC server flags diff --git a/go/cmd/vtctld/cli/cli.go b/go/cmd/vtctld/cli/cli.go index 7281438110b..50dcd275aca 100644 --- a/go/cmd/vtctld/cli/cli.go +++ b/go/cmd/vtctld/cli/cli.go @@ -47,7 +47,7 @@ This is demonstrated in the example usage below.`, --backup_storage_implementation file \ --file_backup_storage_root $VTDATAROOT/backups \ --port 15000 \ - --grpc_port 15999`, + --grpc-port 15999`, Args: cobra.NoArgs, Version: servenv.AppVersion.String(), PreRunE: servenv.CobraPreRunE, diff --git a/go/cmd/vtgate/cli/cli.go b/go/cmd/vtgate/cli/cli.go index 7756bb1e226..f19d08efacd 100644 --- a/go/cmd/vtgate/cli/cli.go +++ b/go/cmd/vtgate/cli/cli.go @@ -61,7 +61,7 @@ var ( --topo-global-root /vitess/global \ --log_dir $VTDATAROOT/tmp \ --port 15001 \ - --grpc_port 15991 \ + --grpc-port 15991 \ --mysql_server_port 15306 \ --cell test \ --cells_to_watch test \ diff --git a/go/cmd/vttablet/cli/cli.go b/go/cmd/vttablet/cli/cli.go index ceb7382c489..4628b67f68b 100644 --- a/go/cmd/vttablet/cli/cli.go +++ b/go/cmd/vttablet/cli/cli.go @@ -93,7 +93,7 @@ vttablet \ --init_shard $shard \ --init_tablet_type $tablet_type \ --port $port \ - --grpc_port $grpc_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.", Args: cobra.NoArgs, Version: servenv.AppVersion.String(), diff --git a/go/cmd/vttablet/cli/cli_test.go b/go/cmd/vttablet/cli/cli_test.go index b83235c7d68..698eede087e 100644 --- a/go/cmd/vttablet/cli/cli_test.go +++ b/go/cmd/vttablet/cli/cli_test.go @@ -18,7 +18,6 @@ package cli import ( "context" - // "fmt" "os" "testing" diff --git a/go/cmd/vttestserver/cli/main_test.go b/go/cmd/vttestserver/cli/main_test.go index d417b5c4190..6be0cdc3eed 100644 --- a/go/cmd/vttestserver/cli/main_test.go +++ b/go/cmd/vttestserver/cli/main_test.go @@ -38,6 +38,8 @@ import ( "vitess.io/vitess/go/vt/log" "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" @@ -302,14 +304,14 @@ func TestMtlsAuth(t *testing.T) { // When cluster starts it will apply SQL and VSchema migrations in the configured schema_dir folder // With mtls authorization enabled, the authorized CN must match the certificate's CN cluster, err := startCluster( - "--grpc_auth_mode=mtls", - fmt.Sprintf("--grpc_key=%s", key), - fmt.Sprintf("--grpc_cert=%s", cert), - fmt.Sprintf("--grpc_ca=%s", caCert), + utils.GetFlagVariantForTests("--grpc-auth-mode")+"=mtls", + fmt.Sprintf("%s=%s", utils.GetFlagVariantForTests("--grpc-key"), key), + fmt.Sprintf("%s=%s", utils.GetFlagVariantForTests("--grpc-cert"), cert), + fmt.Sprintf("%s=%s", utils.GetFlagVariantForTests("--grpc-ca"), caCert), fmt.Sprintf("--vtctld_grpc_key=%s", clientKey), fmt.Sprintf("--vtctld_grpc_cert=%s", clientCert), fmt.Sprintf("--vtctld_grpc_ca=%s", caCert), - fmt.Sprintf("--grpc_auth_mtls_allowed_substrings=%s", "CN=ClientApp")) + fmt.Sprintf("%s=%s", utils.GetFlagVariantForTests("--grpc-auth-mtls-allowed-substrings"), "CN=ClientApp")) require.NoError(t, err) defer func() { cluster.PersistentMode = false // Cleanup the tmpdir as we're done @@ -344,14 +346,14 @@ func TestMtlsAuthUnauthorizedFails(t *testing.T) { // For mtls authorization failure by providing a client certificate with different CN thant the // authorized in the configuration cluster, err := startCluster( - "--grpc_auth_mode=mtls", - fmt.Sprintf("--grpc_key=%s", key), - fmt.Sprintf("--grpc_cert=%s", cert), - fmt.Sprintf("--grpc_ca=%s", caCert), + utils.GetFlagVariantForTests("--grpc-auth-mode")+"=mtls", + fmt.Sprintf("%s=%s", utils.GetFlagVariantForTests("--grpc-key"), key), + fmt.Sprintf("%s=%s", utils.GetFlagVariantForTests("--grpc-cert"), cert), + fmt.Sprintf("%s=%s", utils.GetFlagVariantForTests("--grpc-ca"), caCert), fmt.Sprintf("--vtctld_grpc_key=%s", clientKey), fmt.Sprintf("--vtctld_grpc_cert=%s", clientCert), fmt.Sprintf("--vtctld_grpc_ca=%s", caCert), - fmt.Sprintf("--grpc_auth_mtls_allowed_substrings=%s", "CN=ClientApp")) + fmt.Sprintf("--grpc-auth-mtls-allowed-substrings=%s", "CN=ClientApp")) defer cluster.TearDown() require.Error(t, err) diff --git a/go/flags/endtoend/mysqlctld.txt b/go/flags/endtoend/mysqlctld.txt index 22c5f37d63f..3ee01346ade 100644 --- a/go/flags/endtoend/mysqlctld.txt +++ b/go/flags/endtoend/mysqlctld.txt @@ -61,32 +61,32 @@ Flags: --db_tls_min_version string Configures the minimal TLS version negotiated when SSL is enabled. Defaults to TLSv1.2. Options: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3. --dba_idle_timeout duration Idle timeout for dba connections (default 1m0s) --dba_pool_size int Size of the connection pool for dba connections (default 20) + --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. + --grpc-auth-static-password-file string JSON File to read the users/passwords from. + --grpc-bind-address string Bind address for gRPC calls. If empty, listen on all addresses. + --grpc-ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check + --grpc-cert string server certificate to use for gRPC connections, requires grpc-key, enables TLS + --grpc-compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy + --grpc-crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake --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) - --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. - --grpc_auth_static_password_file string JSON File to read the users/passwords from. - --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses. - --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check - --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS - --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy - --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake - --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS - --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) - --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) - --grpc_port int Port to listen on for gRPC calls. If zero, do not listen. - --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients - --grpc_server_initial_conn_window_size int gRPC server initial connection window size - --grpc_server_initial_window_size int gRPC server initial window size - --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s) - --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) - --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) + --grpc-enable-optional-tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-key string server private key to use for gRPC connections, requires grpc-cert, enables TLS + --grpc-max-connection-age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) + --grpc-max-connection-age-grace duration Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) + --grpc-port int Port to listen on for gRPC calls. If zero, do not listen. + --grpc-server-ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients + --grpc-server-initial-conn-window-size int gRPC server initial connection window size + --grpc-server-initial-window-size int gRPC server initial window size + --grpc-server-keepalive-enforcement-policy-min-time duration gRPC server minimum keepalive time (default 10s) + --grpc-server-keepalive-enforcement-policy-permit-without-stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) + --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 mysqlctld --init_db_sql_file string Path to .sql file to run after mysqld initialization --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) diff --git a/go/flags/endtoend/topo2topo.txt b/go/flags/endtoend/topo2topo.txt index c003c3584f3..3f3f09c2ae9 100644 --- a/go/flags/endtoend/topo2topo.txt +++ b/go/flags/endtoend/topo2topo.txt @@ -21,9 +21,9 @@ Flags: --from_implementation string topology implementation to copy data from --from_root string topology server root to copy data from --from_server string topology server address to copy data from - --grpc_enable_tracing Enable gRPC tracing. - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_prometheus Enable gRPC monitoring with Prometheus. + --grpc-enable-tracing Enable gRPC tracing. + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-prometheus Enable gRPC monitoring with Prometheus. -h, --help help for topo2topo --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) diff --git a/go/flags/endtoend/vtbackup.txt b/go/flags/endtoend/vtbackup.txt index 7040e10484d..fc90f93d713 100644 --- a/go/flags/endtoend/vtbackup.txt +++ b/go/flags/endtoend/vtbackup.txt @@ -134,16 +134,16 @@ Flags: --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. + --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) - --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_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_prometheus Enable gRPC monitoring with Prometheus. + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --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 diff --git a/go/flags/endtoend/vtbench.txt b/go/flags/endtoend/vtbench.txt index 7b0d72af429..ef1bcf7a08b 100644 --- a/go/flags/endtoend/vtbench.txt +++ b/go/flags/endtoend/vtbench.txt @@ -51,15 +51,16 @@ Flags: --count int Number of queries per thread (default 1000) --db string Database name to use when connecting / running the queries (e.g. @replica, keyspace, keyspace/shard etc) --deadline duration Maximum duration for the test run (default 5 minutes) (default 5m0s) - --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_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_prometheus Enable gRPC monitoring with Prometheus. + --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) + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-prometheus Enable gRPC monitoring with Prometheus. -h, --help help for vtbench --host string VTGate host(s) in the form 'host1,host2,...' --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) diff --git a/go/flags/endtoend/vtclient.txt b/go/flags/endtoend/vtclient.txt index 6c0a87d6551..aa1905d3759 100644 --- a/go/flags/endtoend/vtclient.txt +++ b/go/flags/endtoend/vtclient.txt @@ -21,10 +21,20 @@ Flags: --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). --count int DMLs only: Number of times each thread executes the query. Useful for simple, sustained load testing. (default 1) - --grpc_enable_tracing Enable gRPC tracing. - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_prometheus Enable gRPC monitoring with Prometheus. + --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 + --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) + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-prometheus Enable gRPC monitoring with Prometheus. -h, --help help for vtclient + --jaeger-agent-host string host and port to send spans to. if empty, no tracing will be done --json Output JSON instead of human-readable table --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) @@ -47,7 +57,17 @@ Flags: --streaming use a streaming query --target string keyspace:shard@tablet_type --timeout duration timeout for queries (default 30s) + --tracer string tracing service to use (default "noop") + --tracing-enable-logging whether to enable logging in the tracing service + --tracing-sampling-rate float sampling rate for the probabilistic jaeger sampler (default 0.1) + --tracing-sampling-type string sampling strategy to use for jaeger. possible values are 'const', 'probabilistic', 'rateLimiting', or 'remote' (default "const") --use_random_sequence use random sequence for generating [min_sequence_id, max_sequence_id) --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 + --vtgate_grpc_ca string the server ca to use to validate servers when connecting + --vtgate_grpc_cert string the cert to use to connect + --vtgate_grpc_crl string the server crl to use to validate server certificates when connecting + --vtgate_grpc_key string the key to use to connect + --vtgate_grpc_server_name string the server name to use to validate server certificate + --vtgate_protocol string how to talk to vtgate (default "grpc") diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index ec3ed87210e..49b76cea688 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -136,31 +136,31 @@ Flags: --gate_query_cache_memory int gate server query cache size in bytes, maximum amount of memory to be cached. vtgate analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache. (default 33554432) --gc_check_interval duration Interval between garbage collection checks (default 1h0m0s) --gc_purge_check_interval duration Interval between purge discovery checks (default 1m0s) + --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-password-file string JSON File to read the users/passwords from. + --grpc-bind-address string Bind address for gRPC calls. If empty, listen on all addresses. + --grpc-ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check + --grpc-cert string server certificate to use for gRPC connections, requires grpc-key, enables TLS + --grpc-crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake + --grpc-enable-optional-tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port + --grpc-enable-tracing Enable gRPC tracing. + --grpc-key string server private key to use for gRPC connections, requires grpc-cert, enables TLS + --grpc-max-connection-age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) + --grpc-max-connection-age-grace duration Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-port int Port to listen on for gRPC calls. If zero, do not listen. + --grpc-prometheus Enable gRPC monitoring with Prometheus. + --grpc-server-ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients + --grpc-server-initial-conn-window-size int gRPC server initial connection window size + --grpc-server-initial-window-size int gRPC server initial window size + --grpc-server-keepalive-enforcement-policy-min-time duration gRPC server minimum keepalive time (default 10s) + --grpc-server-keepalive-enforcement-policy-permit-without-stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) + --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) + --grpc-use-effective-callerid If set, and SSL is not used, will set the immediate caller id from the effective caller id's principal. --grpc-use-effective-groups If set, and SSL is not used, will set the immediate caller's security groups from the effective caller id's groups. --grpc-use-static-authentication-callerid If set, will set the immediate caller id to the username authenticated by the static auth plugin. - --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_password_file string JSON File to read the users/passwords from. - --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses. - --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check - --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS - --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake - --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port - --grpc_enable_tracing Enable gRPC tracing. - --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS - --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) - --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_port int Port to listen on for gRPC calls. If zero, do not listen. - --grpc_prometheus Enable gRPC monitoring with Prometheus. - --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients - --grpc_server_initial_conn_window_size int gRPC server initial connection window size - --grpc_server_initial_window_size int gRPC server initial window size - --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s) - --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) - --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) - --grpc_use_effective_callerid If set, and SSL is not used, will set the immediate caller id from the effective caller id's principal. --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) diff --git a/go/flags/endtoend/vtctlclient.txt b/go/flags/endtoend/vtctlclient.txt index e7402c0eefd..59c51918ada 100644 --- a/go/flags/endtoend/vtctlclient.txt +++ b/go/flags/endtoend/vtctlclient.txt @@ -9,16 +9,16 @@ Usage of vtctlclient: --config-type string Config file type (omit to infer config type from file extension). --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 + --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) - --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_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_prometheus Enable gRPC monitoring with Prometheus. + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-prometheus Enable gRPC monitoring with Prometheus. -h, --help display usage and exit --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) diff --git a/go/flags/endtoend/vtctld.txt b/go/flags/endtoend/vtctld.txt index 8b37cf26115..d7fe2f59368 100644 --- a/go/flags/endtoend/vtctld.txt +++ b/go/flags/endtoend/vtctld.txt @@ -18,7 +18,7 @@ vtctld \ --backup_storage_implementation file \ --file_backup_storage_root $VTDATAROOT/backups \ --port 15000 \ - --grpc_port 15999 + --grpc-port 15999 Flags: --action_timeout duration time to wait for an action before resorting to force (default 1m0s) @@ -57,35 +57,35 @@ Flags: --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. + --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. + --grpc-auth-static-password-file string JSON File to read the users/passwords from. + --grpc-bind-address string Bind address for gRPC calls. If empty, listen on all addresses. + --grpc-ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check + --grpc-cert string server certificate to use for gRPC connections, requires grpc-key, enables TLS + --grpc-compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy + --grpc-crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake --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) - --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. - --grpc_auth_static_password_file string JSON File to read the users/passwords from. - --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses. - --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check - --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS - --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy - --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake - --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port - --grpc_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS - --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) - --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_port int Port to listen on for gRPC calls. If zero, do not listen. - --grpc_prometheus Enable gRPC monitoring with Prometheus. - --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients - --grpc_server_initial_conn_window_size int gRPC server initial connection window size - --grpc_server_initial_window_size int gRPC server initial window size - --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s) - --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) - --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) + --grpc-enable-optional-tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-key string server private key to use for gRPC connections, requires grpc-cert, enables TLS + --grpc-max-connection-age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) + --grpc-max-connection-age-grace duration Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-port int Port to listen on for gRPC calls. If zero, do not listen. + --grpc-prometheus Enable gRPC monitoring with Prometheus. + --grpc-server-ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients + --grpc-server-initial-conn-window-size int gRPC server initial connection window size + --grpc-server-initial-window-size int gRPC server initial window size + --grpc-server-keepalive-enforcement-policy-min-time duration gRPC server minimum keepalive time (default 10s) + --grpc-server-keepalive-enforcement-policy-permit-without-stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) + --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 vtctld --jaeger-agent-host string host and port to send spans to. if empty, no tracing will be done --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) diff --git a/go/flags/endtoend/vtctldclient.txt b/go/flags/endtoend/vtctldclient.txt index 0e0c91fbf7d..2a0279ecfbf 100644 --- a/go/flags/endtoend/vtctldclient.txt +++ b/go/flags/endtoend/vtctldclient.txt @@ -121,15 +121,15 @@ Flags: --action_timeout duration timeout to use for the command (default 1h0m0s) --alsologtostderr log to standard error as well as files --compact use compact format for otherwise verbose outputs - --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_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_prometheus Enable gRPC monitoring with Prometheus. + --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-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-prometheus Enable gRPC monitoring with Prometheus. -h, --help help for vtctldclient --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) diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt index ca950c7adc3..a835636475f 100644 --- a/go/flags/endtoend/vtgate.txt +++ b/go/flags/endtoend/vtgate.txt @@ -15,7 +15,7 @@ vtgate \ --topo-global-root /vitess/global \ --log_dir $VTDATAROOT/tmp \ --port 15001 \ - --grpc_port 15991 \ + --grpc-port 15991 \ --mysql_server_port 15306 \ --cell test \ --cells_to_watch test \ @@ -67,38 +67,38 @@ Flags: --foreign_key_mode string This is to provide how to handle foreign key constraint in create/alter table. Valid values are: allow, disallow (default "allow") --gate_query_cache_memory int gate server query cache size in bytes, maximum amount of memory to be cached. vtgate analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache. (default 33554432) --gateway_initial_tablet_timeout duration At startup, the tabletGateway will wait up to this duration to get at least one tablet per keyspace/shard/tablet type (default 30s) + --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. + --grpc-auth-static-password-file string JSON File to read the users/passwords from. + --grpc-bind-address string Bind address for gRPC calls. If empty, listen on all addresses. + --grpc-ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check + --grpc-cert string server certificate to use for gRPC connections, requires grpc-key, enables TLS + --grpc-compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy + --grpc-crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake --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) + --grpc-enable-optional-tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-key string server private key to use for gRPC connections, requires grpc-cert, enables TLS + --grpc-max-connection-age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) + --grpc-max-connection-age-grace duration Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-port int Port to listen on for gRPC calls. If zero, do not listen. + --grpc-prometheus Enable gRPC monitoring with Prometheus. + --grpc-server-ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients + --grpc-server-initial-conn-window-size int gRPC server initial connection window size + --grpc-server-initial-window-size int gRPC server initial window size + --grpc-server-keepalive-enforcement-policy-min-time duration gRPC server minimum keepalive time (default 10s) + --grpc-server-keepalive-enforcement-policy-permit-without-stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) + --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) + --grpc-use-effective-callerid If set, and SSL is not used, will set the immediate caller id from the effective caller id's principal. --grpc-use-effective-groups If set, and SSL is not used, will set the immediate caller's security groups from the effective caller id's groups. --grpc-use-static-authentication-callerid If set, will set the immediate caller id to the username authenticated by the static auth plugin. - --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. - --grpc_auth_static_password_file string JSON File to read the users/passwords from. - --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses. - --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check - --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS - --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy - --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake - --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port - --grpc_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS - --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) - --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_port int Port to listen on for gRPC calls. If zero, do not listen. - --grpc_prometheus Enable gRPC monitoring with Prometheus. - --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients - --grpc_server_initial_conn_window_size int gRPC server initial connection window size - --grpc_server_initial_window_size int gRPC server initial window size - --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s) - --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) - --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) - --grpc_use_effective_callerid If set, and SSL is not used, will set the immediate caller id from the effective caller id's principal. --healthcheck_retry_delay duration health check retry delay (default 2ms) --healthcheck_timeout duration the health check timeout period (default 1m0s) -h, --help help for vtgate diff --git a/go/flags/endtoend/vtgateclienttest.txt b/go/flags/endtoend/vtgateclienttest.txt index d5b45e57b1e..59e5f21da0e 100644 --- a/go/flags/endtoend/vtgateclienttest.txt +++ b/go/flags/endtoend/vtgateclienttest.txt @@ -14,35 +14,35 @@ Flags: --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). --default_tablet_type topodatapb.TabletType The default tablet type to set for queries, when one is not explicitly selected. (default PRIMARY) + --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. + --grpc-auth-static-password-file string JSON File to read the users/passwords from. + --grpc-bind-address string Bind address for gRPC calls. If empty, listen on all addresses. + --grpc-ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check + --grpc-cert string server certificate to use for gRPC connections, requires grpc-key, enables TLS + --grpc-compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy + --grpc-crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake --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) - --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. - --grpc_auth_static_password_file string JSON File to read the users/passwords from. - --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses. - --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check - --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS - --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy - --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake - --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port - --grpc_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS - --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) - --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_port int Port to listen on for gRPC calls. If zero, do not listen. - --grpc_prometheus Enable gRPC monitoring with Prometheus. - --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients - --grpc_server_initial_conn_window_size int gRPC server initial connection window size - --grpc_server_initial_window_size int gRPC server initial window size - --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s) - --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) - --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) + --grpc-enable-optional-tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-key string server private key to use for gRPC connections, requires grpc-cert, enables TLS + --grpc-max-connection-age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) + --grpc-max-connection-age-grace duration Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-port int Port to listen on for gRPC calls. If zero, do not listen. + --grpc-prometheus Enable gRPC monitoring with Prometheus. + --grpc-server-ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients + --grpc-server-initial-conn-window-size int gRPC server initial connection window size + --grpc-server-initial-window-size int gRPC server initial window size + --grpc-server-keepalive-enforcement-policy-min-time duration gRPC server minimum keepalive time (default 10s) + --grpc-server-keepalive-enforcement-policy-permit-without-stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) + --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 vtgateclienttest --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) diff --git a/go/flags/endtoend/vtorc.txt b/go/flags/endtoend/vtorc.txt index 81a708beca4..44246e91386 100644 --- a/go/flags/endtoend/vtorc.txt +++ b/go/flags/endtoend/vtorc.txt @@ -37,16 +37,16 @@ Flags: --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 --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 --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) - --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_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_prometheus Enable gRPC monitoring with Prometheus. + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-prometheus Enable gRPC monitoring with Prometheus. -h, --help help for vtorc --instance-poll-time duration Timer duration on which VTOrc refreshes MySQL information (default 5s) --keep_logs duration keep logs for this long (using ctime) (zero to keep forever) diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index 6dc65e50f54..d2a8cca67b2 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -35,7 +35,7 @@ vttablet \ --init_shard $shard \ --init_tablet_type $tablet_type \ --port $port \ - --grpc_port $grpc_port \ + --grpc-port $grpc_port \ --service_map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream' `$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. @@ -162,35 +162,35 @@ Flags: --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. + --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. + --grpc-auth-static-password-file string JSON File to read the users/passwords from. + --grpc-bind-address string Bind address for gRPC calls. If empty, listen on all addresses. + --grpc-ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check + --grpc-cert string server certificate to use for gRPC connections, requires grpc-key, enables TLS + --grpc-compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy + --grpc-crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake --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) - --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. - --grpc_auth_static_password_file string JSON File to read the users/passwords from. - --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses. - --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check - --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS - --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy - --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake - --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port - --grpc_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS - --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) - --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_port int Port to listen on for gRPC calls. If zero, do not listen. - --grpc_prometheus Enable gRPC monitoring with Prometheus. - --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients - --grpc_server_initial_conn_window_size int gRPC server initial connection window size - --grpc_server_initial_window_size int gRPC server initial window size - --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s) - --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) - --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) + --grpc-enable-optional-tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-key string server private key to use for gRPC connections, requires grpc-cert, enables TLS + --grpc-max-connection-age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) + --grpc-max-connection-age-grace duration Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-port int Port to listen on for gRPC calls. If zero, do not listen. + --grpc-prometheus Enable gRPC monitoring with Prometheus. + --grpc-server-ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients + --grpc-server-initial-conn-window-size int gRPC server initial connection window size + --grpc-server-initial-window-size int gRPC server initial window size + --grpc-server-keepalive-enforcement-policy-min-time duration gRPC server minimum keepalive time (default 10s) + --grpc-server-keepalive-enforcement-policy-permit-without-stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) + --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) diff --git a/go/flags/endtoend/vttestserver.txt b/go/flags/endtoend/vttestserver.txt index c570c4c9369..b52096e496c 100644 --- a/go/flags/endtoend/vttestserver.txt +++ b/go/flags/endtoend/vttestserver.txt @@ -43,35 +43,35 @@ Flags: --external_topo_implementation string the topology implementation to use for vtcombo process --extra_my_cnf string extra files to add to the config, separated by ':' --foreign_key_mode string This is to provide how to handle foreign key constraint in create/alter table. Valid values are: allow, disallow (default "allow") + --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. + --grpc-auth-static-password-file string JSON File to read the users/passwords from. + --grpc-bind-address string Bind address for gRPC calls. If empty, listen on all addresses. + --grpc-ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check + --grpc-cert string server certificate to use for gRPC connections, requires grpc-key, enables TLS + --grpc-compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy + --grpc-crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake --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) - --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. - --grpc_auth_static_password_file string JSON File to read the users/passwords from. - --grpc_bind_address string Bind address for gRPC calls. If empty, listen on all addresses. - --grpc_ca string server CA to use for gRPC connections, requires TLS, and enforces client certificate check - --grpc_cert string server certificate to use for gRPC connections, requires grpc_key, enables TLS - --grpc_compression string Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy - --grpc_crl string path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake - --grpc_enable_optional_tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port - --grpc_enable_tracing Enable gRPC tracing. - --grpc_initial_conn_window_size int gRPC initial connection window size - --grpc_initial_window_size int gRPC initial window size - --grpc_keepalive_time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) - --grpc_keepalive_timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) - --grpc_key string server private key to use for gRPC connections, requires grpc_cert, enables TLS - --grpc_max_connection_age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) - --grpc_max_connection_age_grace duration Additional grace period after grpc_max_connection_age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) - --grpc_max_message_size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) - --grpc_port int Port to listen on for gRPC calls. If zero, do not listen. - --grpc_prometheus Enable gRPC monitoring with Prometheus. - --grpc_server_ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients - --grpc_server_initial_conn_window_size int gRPC server initial connection window size - --grpc_server_initial_window_size int gRPC server initial window size - --grpc_server_keepalive_enforcement_policy_min_time duration gRPC server minimum keepalive time (default 10s) - --grpc_server_keepalive_enforcement_policy_permit_without_stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) - --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) + --grpc-enable-optional-tls enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port + --grpc-enable-tracing Enable gRPC tracing. + --grpc-initial-conn-window-size int gRPC initial connection window size + --grpc-initial-window-size int gRPC initial window size + --grpc-keepalive-time duration After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s) + --grpc-keepalive-timeout duration After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s) + --grpc-key string server private key to use for gRPC connections, requires grpc-cert, enables TLS + --grpc-max-connection-age duration Maximum age of a client connection before GoAway is sent. (default 2562047h47m16.854775807s) + --grpc-max-connection-age-grace duration Additional grace period after grpc-max-connection-age, after which connections are forcibly closed. (default 2562047h47m16.854775807s) + --grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216) + --grpc-port int Port to listen on for gRPC calls. If zero, do not listen. + --grpc-prometheus Enable gRPC monitoring with Prometheus. + --grpc-server-ca string path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients + --grpc-server-initial-conn-window-size int gRPC server initial connection window size + --grpc-server-initial-window-size int gRPC server initial window size + --grpc-server-keepalive-enforcement-policy-min-time duration gRPC server minimum keepalive time (default 10s) + --grpc-server-keepalive-enforcement-policy-permit-without-stream gRPC server permit client keepalive pings even when there are no active streams (RPCs) + --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-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. diff --git a/go/test/endtoend/cluster/vtbackup_process.go b/go/test/endtoend/cluster/vtbackup_process.go index 5162662e281..b6d4d291368 100644 --- a/go/test/endtoend/cluster/vtbackup_process.go +++ b/go/test/endtoend/cluster/vtbackup_process.go @@ -83,24 +83,6 @@ func (vtbackup *VtbackupProcess) Setup() (err error) { vtbackup.proc.Args = append(vtbackup.proc.Args, k, v) } - // vtbackup.proc = exec.Command( - // vtbackup.Binary, - // "--topo-implementation", vtbackup.TopoImplementation, - // "--topo-global-server-address", vtbackup.TopoGlobalAddress, - // "--topo-global-root", vtbackup.TopoGlobalRoot, - // "--log_dir", vtbackup.LogDir, - - // //initDBfile is required to run vtbackup - // "--mysql_port", fmt.Sprintf("%d", vtbackup.MysqlPort), - // "--init_db_sql_file", vtbackup.initDBfile, - // "--init_keyspace", vtbackup.Keyspace, - // "--init_shard", vtbackup.Shard, - - // //Backup Arguments are not optional - // "--backup_storage_implementation", vtbackup.BackupStorageImplementation, - // "--file_backup_storage_root", vtbackup.FileBackupStorageRoot, - // ) - if vtbackup.initialBackup { vtbackup.proc.Args = append(vtbackup.proc.Args, "--initial_backup") } diff --git a/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go b/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go index 95411536905..cf54dc4aa69 100644 --- a/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go +++ b/go/test/endtoend/encryption/encryptedtransport/encrypted_transport_test.go @@ -69,6 +69,7 @@ import ( "vitess.io/vitess/go/test/endtoend/encryption" "vitess.io/vitess/go/vt/proto/vtrpc" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vterrors" "github.com/stretchr/testify/assert" @@ -203,7 +204,7 @@ func useEffectiveCallerID(ctx context.Context, t *testing.T) { // now restart vtgate in the mode where we don't use SSL // for client connections, but we copy effective caller id // into immediate caller id. - clusterInstance.VtGateExtraArgs = []string{"--grpc_use_effective_callerid"} + clusterInstance.VtGateExtraArgs = []string{utils.GetFlagVariantForTests("--grpc-use-effective-callerid")} clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, tabletConnExtraArgs("vttablet-client-1")...) err := clusterInstance.RestartVtgate() require.NoError(t, err) @@ -252,7 +253,7 @@ func useEffectiveGroups(ctx context.Context, t *testing.T) { // now restart vtgate in the mode where we don't use SSL // for client connections, but we copy effective caller's groups // into immediate caller id. - clusterInstance.VtGateExtraArgs = []string{"--grpc_use_effective_callerid", "--grpc-use-effective-groups"} + clusterInstance.VtGateExtraArgs = []string{utils.GetFlagVariantForTests("--grpc-use-effective-callerid"), utils.GetFlagVariantForTests("--grpc-use-effective-groups")} clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, tabletConnExtraArgs("vttablet-client-1")...) err := clusterInstance.RestartVtgate() require.NoError(t, err) @@ -424,9 +425,11 @@ func createSignedCert(ca string, serial string, name string, commonName string) } func serverExtraArguments(name string, ca string) []string { - args := []string{"--grpc_cert", certDirectory + "/" + name + "-cert.pem", - "--grpc_key", certDirectory + "/" + name + "-key.pem", - "--grpc_ca", certDirectory + "/" + ca + "-cert.pem"} + args := []string{ + utils.GetFlagVariantForTests("--grpc-cert"), certDirectory + "/" + name + "-cert.pem", + utils.GetFlagVariantForTests("--grpc-key"), certDirectory + "/" + name + "-key.pem", + utils.GetFlagVariantForTests("--grpc-ca"), certDirectory + "/" + ca + "-cert.pem", + } return args } diff --git a/go/test/endtoend/mysqlserver/main_test.go b/go/test/endtoend/mysqlserver/main_test.go index 20da69e18e8..a35c96030b9 100644 --- a/go/test/endtoend/mysqlserver/main_test.go +++ b/go/test/endtoend/mysqlserver/main_test.go @@ -64,8 +64,8 @@ func TestMain(m *testing.M) { flag.Parse() // setting grpc max size - if os.Getenv("grpc_max_massage_size") == "" { - os.Setenv("grpc_max_message_size", strconv.FormatInt(16*1024*1024, 10)) + if os.Getenv("grpc-max-message-size") == "" { + os.Setenv("grpc-max-message-size", strconv.FormatInt(16*1024*1024, 10)) } exitcode, err := func() (int, error) { diff --git a/go/test/endtoend/mysqlserver/mysql_server_test.go b/go/test/endtoend/mysqlserver/mysql_server_test.go index ee6e973593b..b518a125b0e 100644 --- a/go/test/endtoend/mysqlserver/mysql_server_test.go +++ b/go/test/endtoend/mysqlserver/mysql_server_test.go @@ -93,7 +93,7 @@ func TestInsertLargerThenGrpcLimit(t *testing.T) { require.Nilf(t, err, "unable to connect mysql: %v", err) defer conn.Close() - grpcLimit := os.Getenv("grpc_max_message_size") + grpcLimit := os.Getenv("grpc-max-message-size") limit, err := strconv.Atoi(grpcLimit) require.Nilf(t, err, "int parsing error: %v", err) diff --git a/go/test/endtoend/transaction/twopc/fuzz/main_test.go b/go/test/endtoend/transaction/twopc/fuzz/main_test.go index 3516bdefe05..90ce9385102 100644 --- a/go/test/endtoend/transaction/twopc/fuzz/main_test.go +++ b/go/test/endtoend/transaction/twopc/fuzz/main_test.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/transaction/twopc/utils" + vtutils "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" ) @@ -66,7 +67,7 @@ func TestMain(m *testing.M) { // Set extra args for twopc clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--transaction_mode", "TWOPC", - "--grpc_use_effective_callerid", + vtutils.GetFlagVariantForTests("--grpc-use-effective-callerid"), "--tablet_refresh_interval", "2s", ) clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, diff --git a/go/test/endtoend/transaction/twopc/main_test.go b/go/test/endtoend/transaction/twopc/main_test.go index 7a2f7e8676e..ee6b5299c33 100644 --- a/go/test/endtoend/transaction/twopc/main_test.go +++ b/go/test/endtoend/transaction/twopc/main_test.go @@ -41,6 +41,7 @@ import ( binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" querypb "vitess.io/vitess/go/vt/proto/query" topodatapb "vitess.io/vitess/go/vt/proto/topodata" + vtutils "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtgate/vtgateconn" ) @@ -78,7 +79,7 @@ func TestMain(m *testing.M) { // Set extra args for twopc clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, - "--grpc_use_effective_callerid", + vtutils.GetFlagVariantForTests("--grpc-use-effective-callerid"), ) clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--twopc_abandon_age", "1", diff --git a/go/test/endtoend/transaction/twopc/metric/main_test.go b/go/test/endtoend/transaction/twopc/metric/main_test.go index 0018f5d45d8..f1866830266 100644 --- a/go/test/endtoend/transaction/twopc/metric/main_test.go +++ b/go/test/endtoend/transaction/twopc/metric/main_test.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" twopcutil "vitess.io/vitess/go/test/endtoend/transaction/twopc/utils" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" ) @@ -66,7 +67,7 @@ func TestMain(m *testing.M) { // Set extra args for twopc clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--transaction_mode", "TWOPC", - "--grpc_use_effective_callerid", + utils.GetFlagVariantForTests("--grpc-use-effective-callerid"), ) 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 977fa3f6fd6..f896a75aed3 100644 --- a/go/test/endtoend/transaction/twopc/stress/main_test.go +++ b/go/test/endtoend/transaction/twopc/stress/main_test.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/transaction/twopc/utils" + vtutils "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" ) @@ -66,7 +67,7 @@ func TestMain(m *testing.M) { // Set extra args for twopc clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, "--transaction_mode", "TWOPC", - "--grpc_use_effective_callerid", + vtutils.GetFlagVariantForTests("--grpc-use-effective-callerid"), "--tablet_refresh_interval", "2s", ) clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, diff --git a/go/test/endtoend/vtgate/grpc_api/main_test.go b/go/test/endtoend/vtgate/grpc_api/main_test.go index e8e116494a2..76ffcc64b0b 100644 --- a/go/test/endtoend/vtgate/grpc_api/main_test.go +++ b/go/test/endtoend/vtgate/grpc_api/main_test.go @@ -24,6 +24,7 @@ import ( "testing" "vitess.io/vitess/go/test/endtoend/cluster" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -106,10 +107,10 @@ func TestMain(m *testing.M) { // Configure vtgate to use static auth clusterInstance.VtGateExtraArgs = []string{ - "--grpc_auth_mode", "static", - "--grpc_auth_static_password_file", grpcServerAuthStaticPath, - "--grpc_use_effective_callerid", - "--grpc-use-static-authentication-callerid", + utils.GetFlagVariantForTests("--grpc-auth-mode"), "static", + utils.GetFlagVariantForTests("--grpc-auth-static-password-file"), grpcServerAuthStaticPath, + utils.GetFlagVariantForTests("--grpc-use-effective-callerid"), + utils.GetFlagVariantForTests("--grpc-use-static-authentication-callerid"), } // Configure vttablet to use table ACL diff --git a/go/test/endtoend/vtgate/queries/kill/main_test.go b/go/test/endtoend/vtgate/queries/kill/main_test.go index 61ddec43589..6466f5e06b3 100644 --- a/go/test/endtoend/vtgate/queries/kill/main_test.go +++ b/go/test/endtoend/vtgate/queries/kill/main_test.go @@ -32,6 +32,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/utils" + vtutils "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtgate/planbuilder" ) @@ -70,7 +71,7 @@ func TestMain(m *testing.M) { var maxGrpcSize int64 = 256 * 1024 * 1024 clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs, "--queryserver-config-max-result-size", "10000000", - "--grpc_max_message_size", strconv.FormatInt(maxGrpcSize, 10)) + vtutils.GetFlagVariantForTests("--grpc-max-message-size"), strconv.FormatInt(maxGrpcSize, 10)) if err := clusterInstance.StartKeyspace(*keyspace, []string{"-80", "80-"}, 0, false); err != nil { return 1 } @@ -78,7 +79,7 @@ func TestMain(m *testing.M) { // Start vtgate clusterInstance.VtGatePlannerVersion = planbuilder.Gen4 clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs, - "--grpc_max_message_size", strconv.FormatInt(maxGrpcSize, 10), + vtutils.GetFlagVariantForTests("--grpc-max-message-size"), strconv.FormatInt(maxGrpcSize, 10), "--max_memory_rows", "999999", "--allow-kill-statement") if err := clusterInstance.StartVtgate(); err != nil { diff --git a/go/test/fuzzing/vtctl_fuzzer.dict b/go/test/fuzzing/vtctl_fuzzer.dict index a2b61b4ead2..65fb5999575 100644 --- a/go/test/fuzzing/vtctl_fuzzer.dict +++ b/go/test/fuzzing/vtctl_fuzzer.dict @@ -46,7 +46,7 @@ "-hostname" "-mysql_port" "-port" -"-grpc_port" +"-grpc-port" "-tags" "-keyspace" "-shard" diff --git a/go/vt/grpcclient/client.go b/go/vt/grpcclient/client.go index 938da95bce6..e35371677f4 100644 --- a/go/vt/grpcclient/client.go +++ b/go/vt/grpcclient/client.go @@ -38,6 +38,7 @@ import ( "vitess.io/vitess/go/vt/grpccommon" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vttls" ) @@ -71,13 +72,14 @@ var ( ) func RegisterFlags(fs *pflag.FlagSet) { - fs.DurationVar(&keepaliveTime, "grpc_keepalive_time", keepaliveTime, "After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive.") - fs.DurationVar(&keepaliveTimeout, "grpc_keepalive_timeout", keepaliveTimeout, "After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.") - fs.IntVar(&initialConnWindowSize, "grpc_initial_conn_window_size", initialConnWindowSize, "gRPC initial connection window size") - fs.IntVar(&initialWindowSize, "grpc_initial_window_size", initialWindowSize, "gRPC initial window size") - fs.StringVar(&compression, "grpc_compression", compression, "Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy") - fs.StringVar(&credsFile, "grpc_auth_static_client_creds", credsFile, "When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.") + utils.SetFlagDurationVar(fs, &keepaliveTime, "grpc-keepalive-time", keepaliveTime, "After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive.") + utils.SetFlagDurationVar(fs, &keepaliveTimeout, "grpc-keepalive-timeout", keepaliveTimeout, "After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.") + utils.SetFlagIntVar(fs, &initialConnWindowSize, "grpc-initial-conn-window-size", initialConnWindowSize, "gRPC initial connection window size") + utils.SetFlagIntVar(fs, &initialWindowSize, "grpc-initial-window-size", initialWindowSize, "gRPC initial window size") + utils.SetFlagStringVar(fs, &compression, "grpc-compression", compression, "Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy") + + utils.SetFlagStringVar(fs, &credsFile, "grpc-auth-static-client-creds", credsFile, "When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.") } func RegisterDeprecatedDialConcurrencyFlagsHealthcheck(fs *pflag.FlagSet) { @@ -91,7 +93,7 @@ func RegisterDeprecatedDialConcurrencyFlagsHealthcheckForVtcombo(fs *pflag.FlagS } func RegisterDialConcurrencyFlags(fs *pflag.FlagSet) { - fs.Int64Var(&dialConcurrencyLimit, "grpc-dial-concurrency-limit", 1024, "Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000.") + utils.SetFlagInt64Var(fs, &dialConcurrencyLimit, "grpc-dial-concurrency-limit", 1024, "Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000.") } func init() { diff --git a/go/vt/grpcclient/client_auth_static.go b/go/vt/grpcclient/client_auth_static.go index bbb91a9fa55..e46e6fd89bc 100644 --- a/go/vt/grpcclient/client_auth_static.go +++ b/go/vt/grpcclient/client_auth_static.go @@ -31,7 +31,7 @@ import ( ) var ( - credsFile string // registered as --grpc_auth_static_client_creds in RegisterFlags + credsFile string // registered as --grpc-auth-static-client-creds in RegisterFlags // StaticAuthClientCreds implements client interface to be able to WithPerRPCCredentials _ credentials.PerRPCCredentials = (*StaticAuthClientCreds)(nil) diff --git a/go/vt/grpcclient/client_test.go b/go/vt/grpcclient/client_test.go index 369ec8da17b..336b4f16769 100644 --- a/go/vt/grpcclient/client_test.go +++ b/go/vt/grpcclient/client_test.go @@ -31,6 +31,7 @@ import ( vtgatepb "vitess.io/vitess/go/vt/proto/vtgate" vtgateservicepb "vitess.io/vitess/go/vt/proto/vtgateservice" + "vitess.io/vitess/go/vt/utils" ) func TestDialErrors(t *testing.T) { @@ -92,8 +93,21 @@ func TestRegisterGRPCClientFlags(t *testing.T) { require.Equal(t, "", compression) require.Equal(t, "", credsFile) + // Use SetFlagVariantsForTests to randomly pick dashed or underscored keys. + flagMap := map[string]string{} + utils.SetFlagVariantsForTests(flagMap, "--grpc-keepalive-time", "5s") + utils.SetFlagVariantsForTests(flagMap, "--grpc-keepalive-timeout", "5s") + utils.SetFlagVariantsForTests(flagMap, "--grpc-initial-conn-window-size", "10") + utils.SetFlagVariantsForTests(flagMap, "--grpc-initial-window-size", "10") + utils.SetFlagVariantsForTests(flagMap, "--grpc-compression", "not-snappy") + utils.SetFlagVariantsForTests(flagMap, "--grpc-auth-static-client-creds", "tempfile") + // Test setting flags from command-line arguments - os.Args = []string{"test", "--grpc_keepalive_time=5s", "--grpc_keepalive_timeout=5s", "--grpc_initial_conn_window_size=10", "--grpc_initial_window_size=10", "--grpc_compression=not-snappy", "--grpc_auth_static_client_creds=tempfile"} + args := []string{"test"} + for k, v := range flagMap { + args = append(args, k+"="+v) + } + os.Args = args err := fs.Parse(os.Args[1:]) require.NoError(t, err) diff --git a/go/vt/grpccommon/options.go b/go/vt/grpccommon/options.go index 7013b95b95a..bd400321812 100644 --- a/go/vt/grpccommon/options.go +++ b/go/vt/grpccommon/options.go @@ -21,6 +21,7 @@ import ( "google.golang.org/grpc" "vitess.io/vitess/go/stats" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -38,17 +39,17 @@ var ( // calls this function, or call this function directly before parsing // command-line arguments. func RegisterFlags(fs *pflag.FlagSet) { - fs.IntVar(&maxMessageSize, "grpc_max_message_size", maxMessageSize, "Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'.") - fs.BoolVar(&grpc.EnableTracing, "grpc_enable_tracing", grpc.EnableTracing, "Enable gRPC tracing.") - fs.BoolVar(&enablePrometheus, "grpc_prometheus", enablePrometheus, "Enable gRPC monitoring with Prometheus.") + utils.SetFlagIntVar(fs, &maxMessageSize, "grpc-max-message-size", maxMessageSize, "Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'.") + utils.SetFlagBoolVar(fs, &grpc.EnableTracing, "grpc-enable-tracing", grpc.EnableTracing, "Enable gRPC tracing.") + utils.SetFlagBoolVar(fs, &enablePrometheus, "grpc-prometheus", enablePrometheus, "Enable gRPC monitoring with Prometheus.") } -// EnableGRPCPrometheus returns the value of the --grpc_prometheus flag. +// EnableGRPCPrometheus returns the value of the --grpc-prometheus flag. func EnableGRPCPrometheus() bool { return enablePrometheus } -// MaxMessageSize returns the value of the --grpc_max_message_size flag. +// MaxMessageSize returns the value of the --grpc-max-message-size flag. func MaxMessageSize() int { return maxMessageSize } diff --git a/go/vt/servenv/grpc_auth.go b/go/vt/servenv/grpc_auth.go index 7cbbce7d65a..a9b3c86c273 100644 --- a/go/vt/servenv/grpc_auth.go +++ b/go/vt/servenv/grpc_auth.go @@ -26,6 +26,7 @@ import ( "google.golang.org/grpc/status" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/utils" ) var grpcAuthServerFlagHooks []func(*pflag.FlagSet) @@ -37,7 +38,7 @@ var grpcAuthServerFlagHooks []func(*pflag.FlagSet) // ParseFlags(WithArgs)? if they wish to expose Authenticator functionality. func RegisterGRPCServerAuthFlags() { OnParse(func(fs *pflag.FlagSet) { - fs.StringVar(&gRPCAuth, "grpc_auth_mode", gRPCAuth, "Which auth plugin implementation to use (eg: static)") + utils.SetFlagStringVar(fs, &gRPCAuth, "grpc-auth-mode", gRPCAuth, "Which auth plugin implementation to use (eg: static)") for _, fn := range grpcAuthServerFlagHooks { fn(fs) @@ -45,7 +46,7 @@ func RegisterGRPCServerAuthFlags() { }) } -// GRPCAuth returns the value of the `--grpc_auth_mode` flag. +// GRPCAuth returns the value of the `--grpc-auth-mode` flag. func GRPCAuth() string { return gRPCAuth } diff --git a/go/vt/servenv/grpc_server.go b/go/vt/servenv/grpc_server.go index 8d30ee6d253..8965ac8952b 100644 --- a/go/vt/servenv/grpc_server.go +++ b/go/vt/servenv/grpc_server.go @@ -38,6 +38,7 @@ import ( "vitess.io/vitess/go/vt/grpccommon" "vitess.io/vitess/go/vt/grpcoptionaltls" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vttls" ) @@ -129,47 +130,48 @@ var ( // ParseFlags(WithArgs)? if they wish to run a gRPC server. func RegisterGRPCServerFlags() { OnParse(func(fs *pflag.FlagSet) { - fs.IntVar(&gRPCPort, "grpc_port", gRPCPort, "Port to listen on for gRPC calls. If zero, do not listen.") - fs.StringVar(&gRPCBindAddress, "grpc_bind_address", gRPCBindAddress, "Bind address for gRPC calls. If empty, listen on all addresses.") - fs.DurationVar(&gRPCMaxConnectionAge, "grpc_max_connection_age", gRPCMaxConnectionAge, "Maximum age of a client connection before GoAway is sent.") - fs.DurationVar(&gRPCMaxConnectionAgeGrace, "grpc_max_connection_age_grace", gRPCMaxConnectionAgeGrace, "Additional grace period after grpc_max_connection_age, after which connections are forcibly closed.") - fs.IntVar(&gRPCInitialConnWindowSize, "grpc_server_initial_conn_window_size", gRPCInitialConnWindowSize, "gRPC server initial connection window size") - fs.IntVar(&gRPCInitialWindowSize, "grpc_server_initial_window_size", gRPCInitialWindowSize, "gRPC server initial window size") - fs.DurationVar(&gRPCKeepAliveEnforcementPolicyMinTime, "grpc_server_keepalive_enforcement_policy_min_time", gRPCKeepAliveEnforcementPolicyMinTime, "gRPC server minimum keepalive time") - fs.BoolVar(&gRPCKeepAliveEnforcementPolicyPermitWithoutStream, "grpc_server_keepalive_enforcement_policy_permit_without_stream", gRPCKeepAliveEnforcementPolicyPermitWithoutStream, "gRPC server permit client keepalive pings even when there are no active streams (RPCs)") - - fs.StringVar(&gRPCCert, "grpc_cert", gRPCCert, "server certificate to use for gRPC connections, requires grpc_key, enables TLS") - fs.StringVar(&gRPCKey, "grpc_key", gRPCKey, "server private key to use for gRPC connections, requires grpc_cert, enables TLS") - fs.StringVar(&gRPCCA, "grpc_ca", gRPCCA, "server CA to use for gRPC connections, requires TLS, and enforces client certificate check") - fs.StringVar(&gRPCCRL, "grpc_crl", gRPCCRL, "path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake") - fs.BoolVar(&gRPCEnableOptionalTLS, "grpc_enable_optional_tls", gRPCEnableOptionalTLS, "enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port") - fs.StringVar(&gRPCServerCA, "grpc_server_ca", gRPCServerCA, "path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients") - fs.DurationVar(&gRPCKeepaliveTime, "grpc_server_keepalive_time", gRPCKeepaliveTime, "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.") - fs.DurationVar(&gRPCKeepaliveTimeout, "grpc_server_keepalive_timeout", gRPCKeepaliveTimeout, "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.") + + utils.SetFlagIntVar(fs, &gRPCPort, "grpc-port", gRPCPort, "Port to listen on for gRPC calls. If zero, do not listen.") + utils.SetFlagStringVar(fs, &gRPCBindAddress, "grpc-bind-address", gRPCBindAddress, "Bind address for gRPC calls. If empty, listen on all addresses.") + utils.SetFlagDurationVar(fs, &gRPCMaxConnectionAge, "grpc-max-connection-age", gRPCMaxConnectionAge, "Maximum age of a client connection before GoAway is sent.") + utils.SetFlagDurationVar(fs, &gRPCMaxConnectionAgeGrace, "grpc-max-connection-age-grace", gRPCMaxConnectionAgeGrace, "Additional grace period after grpc-max-connection-age, after which connections are forcibly closed.") + utils.SetFlagIntVar(fs, &gRPCInitialConnWindowSize, "grpc-server-initial-conn-window-size", gRPCInitialConnWindowSize, "gRPC server initial connection window size") + utils.SetFlagIntVar(fs, &gRPCInitialWindowSize, "grpc-server-initial-window-size", gRPCInitialWindowSize, "gRPC server initial window size") + utils.SetFlagDurationVar(fs, &gRPCKeepAliveEnforcementPolicyMinTime, "grpc-server-keepalive-enforcement-policy-min-time", gRPCKeepAliveEnforcementPolicyMinTime, "gRPC server minimum keepalive time") + utils.SetFlagBoolVar(fs, &gRPCKeepAliveEnforcementPolicyPermitWithoutStream, "grpc-server-keepalive-enforcement-policy-permit-without-stream", gRPCKeepAliveEnforcementPolicyPermitWithoutStream, "gRPC server permit client keepalive pings even when there are no active streams (RPCs)") + + utils.SetFlagStringVar(fs, &gRPCCert, "grpc-cert", gRPCCert, "server certificate to use for gRPC connections, requires grpc-key, enables TLS") + utils.SetFlagStringVar(fs, &gRPCKey, "grpc-key", gRPCKey, "server private key to use for gRPC connections, requires grpc-cert, enables TLS") + utils.SetFlagStringVar(fs, &gRPCCA, "grpc-ca", gRPCCA, "server CA to use for gRPC connections, requires TLS, and enforces client certificate check") + utils.SetFlagStringVar(fs, &gRPCCRL, "grpc-crl", gRPCCRL, "path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake") + utils.SetFlagBoolVar(fs, &gRPCEnableOptionalTLS, "grpc-enable-optional-tls", gRPCEnableOptionalTLS, "enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port") + utils.SetFlagStringVar(fs, &gRPCServerCA, "grpc-server-ca", gRPCServerCA, "path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients") + utils.SetFlagDurationVar(fs, &gRPCKeepaliveTime, "grpc-server-keepalive-time", gRPCKeepaliveTime, "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.") + utils.SetFlagDurationVar(fs, &gRPCKeepaliveTimeout, "grpc-server-keepalive-timeout", gRPCKeepaliveTimeout, "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.") }) } -// GRPCCert returns the value of the `--grpc_cert` flag. +// GRPCCert returns the value of the `--grpc-cert` flag. func GRPCCert() string { return gRPCCert } -// GRPCCertificateAuthority returns the value of the `--grpc_ca` flag. +// GRPCCertificateAuthority returns the value of the `--grpc-ca` flag. func GRPCCertificateAuthority() string { return gRPCCA } -// GRPCKey returns the value of the `--grpc_key` flag. +// GRPCKey returns the value of the `--grpc-key` flag. func GRPCKey() string { return gRPCKey } -// GRPCPort returns the value of the `--grpc_port` flag. +// GRPCPort returns the value of the `--grpc-port` flag. func GRPCPort() int { return gRPCPort } -// GRPCPort returns the value of the `--grpc_bind_address` flag. +// GRPCPort returns the value of the `--grpc-bind-address` flag. func GRPCBindAddress() string { return gRPCBindAddress } diff --git a/go/vt/servenv/grpc_server_auth_mtls.go b/go/vt/servenv/grpc_server_auth_mtls.go index 49116803765..42259ba505a 100644 --- a/go/vt/servenv/grpc_server_auth_mtls.go +++ b/go/vt/servenv/grpc_server_auth_mtls.go @@ -27,6 +27,7 @@ import ( "google.golang.org/grpc/status" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -37,7 +38,7 @@ var ( ) func registerGRPCServerAuthMTLSFlags(fs *pflag.FlagSet) { - fs.StringVar(&clientCertSubstrings, "grpc_auth_mtls_allowed_substrings", clientCertSubstrings, "List of substrings of at least one of the client certificate names (separated by colon).") + utils.SetFlagStringVar(fs, &clientCertSubstrings, "grpc-auth-mtls-allowed-substrings", clientCertSubstrings, "List of substrings of at least one of the client certificate names (separated by colon).") } // MtlsAuthPlugin implements static username/password authentication for grpc. It contains an array of username/passwords @@ -76,7 +77,7 @@ func mtlsAuthPluginInitializer() (Authenticator, error) { } // ClientCertSubstrings returns the value of the -// `--grpc_auth_mtls_allowed_substrings` flag. +// `--grpc-auth-mtls-allowed-substrings` flag. func ClientCertSubstrings() string { return clientCertSubstrings } diff --git a/go/vt/servenv/grpc_server_auth_static.go b/go/vt/servenv/grpc_server_auth_static.go index b7c7142508a..5c4a7a2773c 100644 --- a/go/vt/servenv/grpc_server_auth_static.go +++ b/go/vt/servenv/grpc_server_auth_static.go @@ -28,6 +28,7 @@ import ( "google.golang.org/grpc/status" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/utils" ) var ( @@ -45,7 +46,7 @@ const ( ) func registerGRPCServerAuthStaticFlags(fs *pflag.FlagSet) { - fs.StringVar(&credsFile, "grpc_auth_static_password_file", credsFile, "JSON File to read the users/passwords from.") + utils.SetFlagStringVar(fs, &credsFile, "grpc-auth-static-password-file", credsFile, "JSON File to read the users/passwords from.") } // StaticAuthConfigEntry is the container for server side credentials. Current implementation matches the @@ -98,7 +99,7 @@ func newStaticAuthContext(ctx context.Context, username string) context.Context func staticAuthPluginInitializer() (Authenticator, error) { entries := make([]StaticAuthConfigEntry, 0) if credsFile == "" { - err := fmt.Errorf("failed to load static auth plugin. Plugin configured but grpc_auth_static_password_file not provided") + err := fmt.Errorf("failed to load static auth plugin. Plugin configured but grpc-auth-static-password-file not provided") return nil, err } @@ -116,7 +117,7 @@ func staticAuthPluginInitializer() (Authenticator, error) { staticAuthPlugin := &StaticAuthPlugin{ entries: entries, } - log.Info("static auth plugin have initialized successfully with config from grpc_auth_static_password_file") + log.Info("static auth plugin have initialized successfully with config from grpc-auth-static-password-file") return staticAuthPlugin, nil } diff --git a/go/vt/utils/flags.go b/go/vt/utils/flags.go index dacf1dc0c62..c6ab0ababe3 100644 --- a/go/vt/utils/flags.go +++ b/go/vt/utils/flags.go @@ -99,3 +99,14 @@ func SetFlagVariantsForTests(m map[string]string, key, value string) { m[dashed] = value } } + +// GetFlagVariantForTests randomly returns either the underscored or dashed version of the flag name. +func GetFlagVariantForTests(flagName string) string { + underscored, dashed := flagVariants(flagName) + if rand.Int()%2 == 0 { + // fmt.Print("Using flag variant: ", underscored, "\n") + return underscored + } + // fmt.Print("Using flag variant: ", dashed, "\n") + return dashed +} diff --git a/go/vt/utils/flags_test.go b/go/vt/utils/flags_test.go index 9c8e30a4911..8d47065505c 100644 --- a/go/vt/utils/flags_test.go +++ b/go/vt/utils/flags_test.go @@ -46,21 +46,6 @@ func TestFlagVariants(t *testing.T) { } } -func TestSetMapStringValue(t *testing.T) { - m := make(map[string]string) - key := "test-flag" - value := "some-value" - SetFlagVariants(m, key, value) - - underscored, dashed := flagVariants(key) - if m[underscored] != value { - t.Errorf("Expected m[%q] = %q, got %q", underscored, value, m[underscored]) - } - if m[dashed] != value { - t.Errorf("Expected m[%q] = %q, got %q", dashed, value, m[dashed]) - } -} - // testFlagVar is a generic helper to test both flag setters for various data types. func testFlagVar[T any](t *testing.T, name string, def T, usage string, setter func(fs *pflag.FlagSet, p *T, name string, def T, usage string)) { fs := pflag.NewFlagSet("test", pflag.ContinueOnError) @@ -129,3 +114,25 @@ func TestSetFlagVariantsForTests(t *testing.T) { t.Errorf("Expected only one variant to be set, but both were set") } } + +// TestGetFlagVariantForTests checks that GetFlagVariantForTests returns either the underscored or dashed variant. +func TestGetFlagVariantForTests(t *testing.T) { + tests := []struct { + input string + }{ + {"a-b"}, // expects either "a_b" or "a-b" + {"--a_b"}, // expects either "--a_b" or "--a-b" + {"example"}, // expects "example" + } + + for _, tc := range tests { + underscored, dashed := flagVariants(tc.input) + result := GetFlagVariantForTests(tc.input) + if result != underscored && result != dashed { + t.Errorf( + "Expected either %q or %q for input %q, got %q", + underscored, dashed, tc.input, result, + ) + } + } +} diff --git a/go/vt/vtctl/grpcvtctlclient/client_test.go b/go/vt/vtctl/grpcvtctlclient/client_test.go index 00ec4888e76..912cb8fb3b1 100644 --- a/go/vt/vtctl/grpcvtctlclient/client_test.go +++ b/go/vt/vtctl/grpcvtctlclient/client_test.go @@ -111,10 +111,10 @@ func TestVtctlAuthClient(t *testing.T) { grpcclient.RegisterFlags(fs) err = fs.Parse([]string{ - "--grpc_auth_static_client_creds", + "--grpc-auth-static-client-creds", f.Name(), }) - require.NoError(t, err, "failed to set `--grpc_auth_static_client_creds=%s`", f.Name()) + require.NoError(t, err, "failed to set `--grpc-auth-static-client-creds=%s`", f.Name()) // Create a VtctlClient gRPC client to talk to the fake server client, err := gRPCVtctlClientFactory(ctx, fmt.Sprintf("localhost:%v", port)) diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index db419327799..43e4d1b853d 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, }, @@ -920,7 +920,7 @@ func commandInitTablet(ctx context.Context, wr *wrangler.Wrangler, subFlags *pfl 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") 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") + grpcPort := subFlags.Int("grpc-port", 0, "The gRPC port for the vttablet process") keyspace := subFlags.String("keyspace", "", "The keyspace to which this tablet belongs") shard := subFlags.String("shard", "", "The shard to which this tablet belongs") diff --git a/go/vt/vtgate/grpcvtgateconn/conn_rpc_test.go b/go/vt/vtgate/grpcvtgateconn/conn_rpc_test.go index 4cd52d0f5a0..ab440edfd65 100644 --- a/go/vt/vtgate/grpcvtgateconn/conn_rpc_test.go +++ b/go/vt/vtgate/grpcvtgateconn/conn_rpc_test.go @@ -29,6 +29,7 @@ import ( "vitess.io/vitess/go/vt/grpcclient" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/utils" "vitess.io/vitess/go/vt/vtgate/grpcvtgateservice" "vitess.io/vitess/go/vt/vtgate/vtgateconn" ) @@ -101,11 +102,15 @@ func TestGRPCVTGateConnAuth(t *testing.T) { grpcclient.RegisterFlags(fs) grpcclient.ResetStaticAuth() + authStaticClientCredsFlag := utils.GetFlagVariantForTests("--grpc-auth-static-client-creds") + + // Parse the flag using the chosen variant err = fs.Parse([]string{ - "--grpc_auth_static_client_creds", + authStaticClientCredsFlag, f.Name(), }) - require.NoError(t, err, "failed to set `--grpc_auth_static_client_creds=%s`", f.Name()) + + require.NoError(t, err, "failed to set `%s=%s`", authStaticClientCredsFlag, f.Name()) client, err := dial(ctx, listener.Addr().String()) require.NoError(t, err) RegisterTestDialProtocol(client) @@ -135,11 +140,14 @@ func TestGRPCVTGateConnAuth(t *testing.T) { grpcclient.RegisterFlags(fs) grpcclient.ResetStaticAuth() + authStaticClientCredsFlag = utils.GetFlagVariantForTests("--grpc-auth-static-client-creds") err = fs.Parse([]string{ - "--grpc_auth_static_client_creds", + authStaticClientCredsFlag, f.Name(), }) - require.NoError(t, err, "failed to set `--grpc_auth_static_client_creds=%s`", f.Name()) + + require.NoError(t, err, "failed to set `%s=%s`", authStaticClientCredsFlag, f.Name()) + client, err = dial(ctx, listener.Addr().String()) if err != nil { t.Fatalf("dial failed: %v", err) diff --git a/go/vt/vtgate/grpcvtgateconn/fuzz_flaky_test.go b/go/vt/vtgate/grpcvtgateconn/fuzz_flaky_test.go index fd3202d12ae..202bf82fb4f 100644 --- a/go/vt/vtgate/grpcvtgateconn/fuzz_flaky_test.go +++ b/go/vt/vtgate/grpcvtgateconn/fuzz_flaky_test.go @@ -96,10 +96,10 @@ func Fuzz(data []byte) int { grpcclient.RegisterFlags(fs) err = fs.Parse([]string{ - "--grpc_auth_static_client_creds", + "--grpc-auth-static-client-creds", f.Name(), }) - require.NoError(t, err, "failed to set `--grpc_auth_static_client_creds=%s`", f.Name()) + require.NoError(t, err, "failed to set `--grpc-auth-static-client-creds=%s`", f.Name()) client, err := dial(ctx, listener.Addr().String()) if err != nil { fmt.Println("dial failed") diff --git a/go/vt/vtgate/grpcvtgateservice/server.go b/go/vt/vtgate/grpcvtgateservice/server.go index 46c0bc8f242..ddb1a03c2d9 100644 --- a/go/vt/vtgate/grpcvtgateservice/server.go +++ b/go/vt/vtgate/grpcvtgateservice/server.go @@ -35,6 +35,7 @@ import ( vtgateservicepb "vitess.io/vitess/go/vt/proto/vtgateservice" 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" "vitess.io/vitess/go/vt/vtgate" "vitess.io/vitess/go/vt/vtgate/vtgateservice" @@ -53,10 +54,10 @@ var ( ) func registerFlags(fs *pflag.FlagSet) { - fs.BoolVar(&useEffective, "grpc_use_effective_callerid", false, "If set, and SSL is not used, will set the immediate caller id from the effective caller id's principal.") - fs.BoolVar(&useEffectiveGroups, "grpc-use-effective-groups", false, "If set, and SSL is not used, will set the immediate caller's security groups from the effective caller id's groups.") - fs.BoolVar(&useStaticAuthenticationIdentity, "grpc-use-static-authentication-callerid", false, "If set, will set the immediate caller id to the username authenticated by the static auth plugin.") - fs.BoolVar(&sendSessionInStreaming, "grpc-send-session-in-streaming", true, "If set, will send the session as last packet in streaming api to support transactions in streaming") + utils.SetFlagBoolVar(fs, &useEffective, "grpc-use-effective-callerid", false, "If set, and SSL is not used, will set the immediate caller id from the effective caller id's principal.") + utils.SetFlagBoolVar(fs, &useEffectiveGroups, "grpc-use-effective-groups", false, "If set, and SSL is not used, will set the immediate caller's security groups from the effective caller id's groups.") + utils.SetFlagBoolVar(fs, &useStaticAuthenticationIdentity, "grpc-use-static-authentication-callerid", false, "If set, will set the immediate caller id to the username authenticated by the static auth plugin.") + utils.SetFlagBoolVar(fs, &sendSessionInStreaming, "grpc-send-session-in-streaming", true, "If set, will send the session as last packet in streaming api to support transactions in streaming") _ = fs.MarkDeprecated("grpc-send-session-in-streaming", "This option is deprecated and will be deleted in a future release") } @@ -115,7 +116,7 @@ func withCallerIDContext(ctx context.Context, effectiveCallerID *vtrpcpb.CallerI // The client cert common name (if using mTLS) immediate, securityGroups := immediateCallerIDFromCert(ctx) - // The effective caller id (if --grpc_use_effective_callerid=true) + // The effective caller id (if --grpc-use-effective-callerid=true) if immediate == "" && useEffective && effectiveCallerID != nil { immediate = effectiveCallerID.Principal if useEffectiveGroups && len(effectiveCallerID.Groups) > 0 { diff --git a/go/vt/vttablet/endtoend/udf.so b/go/vt/vttablet/endtoend/udf.so old mode 100755 new mode 100644 diff --git a/go/vt/vttablet/tabletconntest/tabletconntest.go b/go/vt/vttablet/tabletconntest/tabletconntest.go index 416d4de9d00..aa160756ef4 100644 --- a/go/vt/vttablet/tabletconntest/tabletconntest.go +++ b/go/vt/vttablet/tabletconntest/tabletconntest.go @@ -1044,10 +1044,10 @@ func TestSuite(ctx context.Context, t *testing.T, protocol string, tablet *topod grpcclient.RegisterFlags(fs) err := fs.Parse([]string{ - "--grpc_auth_static_client_creds", + "--grpc-auth-static-client-creds", clientCreds.Name(), }) - require.NoError(t, err, "failed to set `--grpc_auth_static_client_creds=%s`", clientCreds.Name()) + require.NoError(t, err, "failed to set `--grpc-auth-static-client-creds=%s`", clientCreds.Name()) } conn, err := tabletconn.GetDialer()(ctx, tablet, grpcclient.FailFast(false)) diff --git a/go/vt/vttest/local_cluster.go b/go/vt/vttest/local_cluster.go index fa7e40feb12..eb2872ef49b 100644 --- a/go/vt/vttest/local_cluster.go +++ b/go/vt/vttest/local_cluster.go @@ -660,14 +660,14 @@ func (db *LocalCluster) JSONConfig() any { config := map[string]any{ "bind_address": db.vt.BindAddress, "port": db.vt.Port, - "grpc_bind_address": db.vt.BindAddressGprc, + "grpc-bind-address": db.vt.BindAddressGprc, "socket": db.mysql.UnixSocket(), "vtcombo_mysql_port": db.Env.PortForProtocol("vtcombo_mysql_port", ""), "mysql": db.Env.PortForProtocol("mysql", ""), } if grpc := db.vt.PortGrpc; grpc != 0 { - config["grpc_port"] = grpc + config["grpc-port"] = grpc } return config diff --git a/go/vt/vttest/vtprocess.go b/go/vt/vttest/vtprocess.go index 54d998ae2af..31f614b1f16 100644 --- a/go/vt/vttest/vtprocess.go +++ b/go/vt/vttest/vtprocess.go @@ -136,12 +136,12 @@ func (vtp *VtProcess) WaitStart() (err error) { ) if vtp.PortGrpc != 0 { - vtp.proc.Args = append(vtp.proc.Args, "--grpc_port") + vtp.proc.Args = append(vtp.proc.Args, "--grpc-port") vtp.proc.Args = append(vtp.proc.Args, fmt.Sprintf("%d", vtp.PortGrpc)) } if vtp.BindAddressGprc != "" { - vtp.proc.Args = append(vtp.proc.Args, "--grpc_bind_address") + vtp.proc.Args = append(vtp.proc.Args, "--grpc-bind-address") vtp.proc.Args = append(vtp.proc.Args, vtp.BindAddressGprc) } @@ -277,7 +277,7 @@ func VtcomboProcess(environment Environment, args *Config, mysql MySQLManager) ( 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()}...) + 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()}...) } if args.VSchemaDDLAuthorizedUsers != "" { vt.ExtraArgs = append(vt.ExtraArgs, []string{"--vschema_ddl_authorized_users", args.VSchemaDDLAuthorizedUsers}...) diff --git a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientStaticAuthTest.java b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientStaticAuthTest.java index d0dfd81fad2..166948fbea4 100644 --- a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientStaticAuthTest.java +++ b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientStaticAuthTest.java @@ -63,10 +63,10 @@ public static void setUpBeforeClass() throws Exception { vtgateclienttest = new ProcessBuilder(Arrays.asList( vtRoot + "/bin/vtgateclienttest", "--logtostderr", - "--grpc_port", Integer.toString(port), + "--grpc-port", Integer.toString(port), "--service_map", "grpc-vtgateservice", - "--grpc_auth_mode", "static", - "--grpc_auth_static_password_file", staticAuthFile.getPath() + "--grpc-auth-mode", "static", + "--grpc-auth-static-password-file", staticAuthFile.getPath() )).inheritIO().start(); Context ctx = Context.getDefault().withDeadlineAfter(Duration.millis(5000L)); diff --git a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTest.java b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTest.java index e3e255c0ea1..2f37c3ef971 100644 --- a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTest.java +++ b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTest.java @@ -55,7 +55,7 @@ public static void setUpBeforeClass() throws Exception { Arrays.asList( vtRoot + "/bin/vtgateclienttest", "--logtostderr", - "--grpc_port", + "--grpc-port", Integer.toString(port), "--service_map", "grpc-vtgateservice")) diff --git a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsClientAuthTest.java b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsClientAuthTest.java index 81fc6016f87..c52db926cb2 100644 --- a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsClientAuthTest.java +++ b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsClientAuthTest.java @@ -173,7 +173,7 @@ private static void startVtgate() throws Exception { final String key = certDirectory.getCanonicalPath() + File.separatorChar + "server-key.pem"; final String vtgateCommand = String.format( - "%s --grpc_cert %s --grpc_key %s --grpc_ca %s --logtostderr --grpc_port %s --service_map grpc-vtgateservice", + "%s --grpc-cert %s --grpc-key %s --grpc-ca %s --logtostderr --grpc-port %s --service_map grpc-vtgateservice", vtRoot + "/bin/vtgateclienttest", cert, key, caCert, Integer.toString(port)); System.out.println(vtgateCommand); vtgateclienttest = new ProcessBuilder(vtgateCommand.split(" ")).inheritIO().start(); diff --git a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsTest.java b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsTest.java index e005bbd528f..576918412f2 100644 --- a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsTest.java +++ b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientTlsTest.java @@ -153,7 +153,7 @@ private static void startVtgate() throws Exception { final String key = certDirectory.getCanonicalPath() + File.separatorChar + "server-key.pem"; final String vtgate = String.format( - "%s --grpc_cert %s --grpc_key %s --logtostderr --grpc_port %s --service_map grpc-vtgateservice", + "%s --grpc-cert %s --grpc-key %s --logtostderr --grpc-port %s --service_map grpc-vtgateservice", vtRoot + "/bin/vtgateclienttest", cert, key, diff --git a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientWithRetriesTest.java b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientWithRetriesTest.java index 6b802cf9be7..452f0e26450 100644 --- a/java/grpc-client/src/test/java/io/client/grpc/GrpcClientWithRetriesTest.java +++ b/java/grpc-client/src/test/java/io/client/grpc/GrpcClientWithRetriesTest.java @@ -50,7 +50,7 @@ public static void setUpBeforeClass() throws Exception { Arrays.asList( vtRoot + "/bin/vtgateclienttest", "--logtostderr", - "--grpc_port", + "--grpc-port", Integer.toString(port), "--service_map", "grpc-vtgateservice"))