Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

servenv: Allow for explicit bind address #13188

Merged
Merged
4 changes: 2 additions & 2 deletions go/flags/endtoend/mysqlctld.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Flags:
--alsologtostderr log to standard error as well as files
--app_idle_timeout duration Idle timeout for app connections (default 1m0s)
--app_pool_size int Size of the connection pool for app connections (default 40)
--bind_address string Bind address for the server.
--bind-address string Bind address for the server.
--catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified
--config-file string Full path of the config file (with extension) to use. If set, --config-path, --config-type, and --config-name are ignored.
--config-file-not-found-handling ConfigFileNotFoundHandling Behavior when a config file is not found. (Options: error, exit, ignore, warn) (default warn)
Expand Down Expand Up @@ -65,7 +65,7 @@ Flags:
--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_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
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtbackup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Flags:
--backup_storage_compress if set, the backup files will be compressed. (default true)
--backup_storage_implementation string Which backup storage implementation to use for creating and restoring backups.
--backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2)
--bind_address string Bind address for the server.
--bind-address string Bind address for the server.
--builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0.
--builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152)
--builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s)
Expand Down
4 changes: 2 additions & 2 deletions go/flags/endtoend/vtctld.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Flags:
--backup_storage_compress if set, the backup files will be compressed. (default true)
--backup_storage_implementation string Which backup storage implementation to use for creating and restoring backups.
--backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2)
--bind_address string Bind address for the server.
--bind-address string Bind address for the server.
--builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0.
--builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152)
--builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s)
Expand All @@ -60,7 +60,7 @@ Flags:
--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_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
Expand Down
4 changes: 2 additions & 2 deletions go/flags/endtoend/vtgate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Flags:
--allow-kill-statement Allows the execution of kill statement
--allowed_tablet_types strings Specifies the tablet types this vtgate is allowed to route queries to. Should be provided as a comma-separated set of tablet types.
--alsologtostderr log to standard error as well as files
--bind_address string Bind address for the server.
--bind-address string Bind address for the server.
--buffer_drain_concurrency int Maximum number of requests retried simultaneously. More concurrency will increase the load on the PRIMARY vttablet when draining the buffer. (default 1)
--buffer_keyspace_shards string If not empty, limit buffering to these entries (comma separated). Entry format: keyspace or keyspace/shard. Requires --enable_buffer=true.
--buffer_max_failover_duration duration Stop buffering completely if a failover takes longer than this duration. (default 20s)
Expand Down Expand Up @@ -71,7 +71,7 @@ Flags:
--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_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
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vtorc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Flags:
--audit-purge-duration duration Duration for which audit logs are held before being purged. Should be in multiples of days (default 168h0m0s)
--audit-to-backend Whether to store the audit log in the VTOrc database
--audit-to-syslog Whether to store the audit log in the syslog
--bind_address string Bind address for the server.
--bind-address string Bind address for the server.
--catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified
--change-tablets-with-errant-gtid-to-drained Whether VTOrc should be changing the type of tablets with errant GTIDs to DRAINED
--clusters_to_watch strings Comma-separated list of keyspaces or keyspace/shards that this instance will monitor and repair. Defaults to all clusters in the topology. Example: "ks1,ks2/-80"
Expand Down
4 changes: 2 additions & 2 deletions go/flags/endtoend/vttablet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Flags:
--backup_storage_compress if set, the backup files will be compressed. (default true)
--backup_storage_implementation string Which backup storage implementation to use for creating and restoring backups.
--backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2)
--bind_address string Bind address for the server.
--bind-address string Bind address for the server.
--binlog_host string PITR restore parameter: hostname/IP of binlog server.
--binlog_password string PITR restore parameter: password of binlog server.
--binlog_player_grpc_ca string the server ca to use to validate servers when connecting
Expand Down Expand Up @@ -171,7 +171,7 @@ Flags:
--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_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
Expand Down
2 changes: 1 addition & 1 deletion go/flags/endtoend/vttestserver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Usage of vttestserver:
--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_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
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/cluster/vtctld_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func (vtctld *VtctldProcess) Setup(cell string, extraArgs ...string) (err error)
if v, err := GetMajorVersion("vtctld"); err != nil {
return err
} else if v >= 18 {
vtctld.proc.Args = append(vtctld.proc.Args, "--bind_address", "127.0.0.1")
vtctld.proc.Args = append(vtctld.proc.Args, "--grpc_bind_address", "127.0.0.1")
vtctld.proc.Args = append(vtctld.proc.Args, "--bind-address", "127.0.0.1")
vtctld.proc.Args = append(vtctld.proc.Args, "--grpc_bind-address", "127.0.0.1")
}

if *isCoverage {
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/cluster/vtgate_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func (vtgate *VtgateProcess) Setup() (err error) {
if v, err := GetMajorVersion("vtgate"); err != nil {
return err
} else if v >= 18 {
args = append(args, "--bind_address", "127.0.0.1")
args = append(args, "--grpc_bind_address", "127.0.0.1")
args = append(args, "--bind-address", "127.0.0.1")
args = append(args, "--grpc_bind-address", "127.0.0.1")
}
// If no explicit mysql_server_version has been specified then we autodetect
// the MySQL version that will be used for the test and base the vtgate's
Expand Down
2 changes: 1 addition & 1 deletion go/test/endtoend/cluster/vtorc_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (orc *VTOrcProcess) Setup() (err error) {
if v, err := GetMajorVersion("vtorc"); err != nil {
return err
} else if v >= 18 {
orc.proc.Args = append(orc.proc.Args, "--bind_address", "127.0.0.1")
orc.proc.Args = append(orc.proc.Args, "--bind-address", "127.0.0.1")
}

if *isCoverage {
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (vttablet *VttabletProcess) Setup() (err error) {
if v, err := GetMajorVersion("vttablet"); err != nil {
return err
} else if v >= 18 {
vttablet.proc.Args = append(vttablet.proc.Args, "--bind_address", "127.0.0.1")
vttablet.proc.Args = append(vttablet.proc.Args, "--grpc_bind_address", "127.0.0.1")
vttablet.proc.Args = append(vttablet.proc.Args, "--bind-address", "127.0.0.1")
vttablet.proc.Args = append(vttablet.proc.Args, "--grpc_bind-address", "127.0.0.1")
}

if *isCoverage {
Expand Down
10 changes: 5 additions & 5 deletions go/test/endtoend/keyspace/keyspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestDeleteKeyspace(t *testing.T) {
// Start over and this time use recursive DeleteKeyspace to do everything.
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateKeyspace", "test_delete_keyspace")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateShard", "test_delete_keyspace/0")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--", "--port=1234", "--bind_address=127.0.0.1", "--keyspace=test_delete_keyspace", "--shard=0", "zone1-0000000100", "primary")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--", "--port=1234", "--bind-address=127.0.0.1", "--keyspace=test_delete_keyspace", "--shard=0", "zone1-0000000100", "primary")

// Create the serving/replication entries and check that they exist,
// so we can later check they're deleted.
Expand Down Expand Up @@ -279,10 +279,10 @@ func TestDeleteKeyspace(t *testing.T) {
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateKeyspace", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateShard", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateShard", "test_delete_keyspace_removekscell/1")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind_address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone1-0000000100", "primary")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind_address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone1-0000000101", "primary")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind_address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone2-0000000100", "replica")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind_address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone2-0000000101", "replica")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone1-0000000100", "primary")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone1-0000000101", "primary")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone2-0000000100", "replica")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone2-0000000101", "replica")

// Create the serving/replication entries and check that they exist, so we can later check they're deleted.
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
Expand Down
2 changes: 1 addition & 1 deletion go/vt/servenv/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ var (
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.StringVar(&gRPCBindAddress, "grpc_bind-address", gRPCBindAddress, "Bind address for gRPC calls. If empty, listen on all addresses.")
Copy link
Contributor

Choose a reason for hiding this comment

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

should we go full-dash here? (i know the other flags use grpc_ as a prefix, we can also "normalize": https://github.com/spf13/pflag#mutating-or-normalizing-flag-names)

Copy link
Member

Choose a reason for hiding this comment

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

I reverted it to use only _, we can find a longer term fix for all flags later.

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")
Expand Down
2 changes: 1 addition & 1 deletion go/vt/servenv/servenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func FireRunHooks() {
func RegisterDefaultFlags() {
OnParse(func(fs *pflag.FlagSet) {
fs.IntVar(&port, "port", port, "port for the server")
fs.StringVar(&bindAddress, "bind_address", bindAddress, "Bind address for the server.")
fs.StringVar(&bindAddress, "bind-address", bindAddress, "Bind address for the server.")
})
}

Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttest/vtprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (vtp *VtProcess) WaitStart() (err error) {
vtp.proc = exec.Command(
vtp.Binary,
"--port", fmt.Sprintf("%d", vtp.Port),
"--bind_address", "127.0.0.1",
"--bind-address", "127.0.0.1",
"--log_dir", vtp.LogDirectory,
"--alsologtostderr",
)
Expand Down
Loading