Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ report
# mise files
.mise.toml
/errors/
go/flags/endtoend/count_flags.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add this to git for now. We can remove once the refactor is done. You can do this in a future PR, don't want to hold this one up for it.

1 change: 1 addition & 0 deletions docker/mini/vtctld-mini-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions docker/mini/vttablet-mini-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions examples/common/scripts/vtctld-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions examples/common/scripts/vtgate-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 4 additions & 2 deletions examples/compose/docker-compose.beginners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ 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' \
--backup_storage_implementation file \
--file_backup_storage_root /vt/vtdataroot/backups \
--logtostderr=true \
--port $WEB_PORT \
--grpc_port $GRPC_PORT
--grpc-port $GRPC_PORT
"]
depends_on:
consul1:
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions examples/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 '
Expand Down
16 changes: 8 additions & 8 deletions examples/compose/vtcompose/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions examples/compose/vtcompose/vtcompose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion examples/compose/vttablet-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 2 additions & 1 deletion go/cmd/vtadmin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/cmd/vtctld/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion go/cmd/vtgate/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion go/cmd/vttablet/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<cell>-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(),
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vttablet/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package cli

import (
"context"
// "fmt"
"os"
"testing"

Expand Down
22 changes: 12 additions & 10 deletions go/cmd/vttestserver/cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
50 changes: 25 additions & 25 deletions go/flags/endtoend/mysqlctld.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading
Loading