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

[release-19.0] parse transaction timeout as duration (#16338) #17406

Merged
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
2 changes: 1 addition & 1 deletion go/cmd/vttestserver/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func New() (cmd *cobra.Command) {
cmd.Flags().BoolVar(&config.EnableSystemSettings, "enable_system_settings", true, "This will enable the system settings to be changed per session at the database connection level")

cmd.Flags().StringVar(&config.TransactionMode, "transaction_mode", "MULTI", "Transaction mode MULTI (default), SINGLE or TWOPC ")
cmd.Flags().Float64Var(&config.TransactionTimeout, "queryserver-config-transaction-timeout", 0, "query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value")
cmd.Flags().DurationVar(&config.TransactionTimeout, "queryserver-config-transaction-timeout", 30*time.Second, "query server transaction timeout, a transaction will be killed if it takes longer than this value")

cmd.Flags().StringVar(&config.TabletHostName, "tablet_hostname", "localhost", "The hostname to use for the tablet otherwise it will be derived from OS' hostname")

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 @@ -103,7 +103,7 @@ Flags:
--pprof-http enable pprof http endpoints (default true)
--proto_topo string Define the fake cluster topology as a compact text format encoded vttest proto. See vttest.proto for more information.
--purge_logs_interval duration how often try to remove old logs (default 1h0m0s)
--queryserver-config-transaction-timeout float query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value
--queryserver-config-transaction-timeout duration query server transaction timeout, a transaction will be killed if it takes longer than this value (default 30s)
--rdonly_count int Rdonly tablets per shard (default 1)
--replica_count int Replica tablets per shard (includes primary) (default 2)
--replication_connect_retry duration how long to wait in between replica reconnect attempts. Only precise to the second. (default 10s)
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vttest/local_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ type Config struct {
// TransactionMode is SINGLE, MULTI or TWOPC
TransactionMode string

TransactionTimeout float64
TransactionTimeout time.Duration

// The host name to use for the table otherwise it will be resolved from the local hostname
TabletHostName string
Expand Down
3 changes: 1 addition & 2 deletions go/vt/vttest/vtprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
"--queryserver-config-schema-reload-time", "60s",
"--queryserver-config-stream-pool-size", "4",
"--queryserver-config-transaction-cap", "4",
"--queryserver-config-transaction-timeout", "300s",
"--queryserver-config-txpool-timeout", "300s",
}

Expand Down Expand Up @@ -259,7 +258,7 @@
vt.ExtraArgs = append(vt.ExtraArgs, []string{"--transaction_mode", args.TransactionMode}...)
}
if args.TransactionTimeout != 0 {
vt.ExtraArgs = append(vt.ExtraArgs, "--queryserver-config-transaction-timeout", fmt.Sprintf("%f", args.TransactionTimeout))
vt.ExtraArgs = append(vt.ExtraArgs, "--queryserver-config-transaction-timeout", fmt.Sprintf("%v", args.TransactionTimeout))

Check warning on line 261 in go/vt/vttest/vtprocess.go

View check run for this annotation

Codecov / codecov/patch

go/vt/vttest/vtprocess.go#L261

Added line #L261 was not covered by tests
}
if args.TabletHostName != "" {
vt.ExtraArgs = append(vt.ExtraArgs, []string{"--tablet_hostname", args.TabletHostName}...)
Expand Down
Loading