Skip to content

Commit

Permalink
parse transaction timeout as duration
Browse files Browse the repository at this point in the history
Signed-off-by: shanth96 <[email protected]>
  • Loading branch information
shanth96 committed Jul 4, 2024
1 parent 694a0cf commit 448563a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go/cmd/vttestserver/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,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", 0, "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/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
2 changes: 1 addition & 1 deletion go/vt/vttest/vtprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func VtcomboProcess(environment Environment, args *Config, mysql MySQLManager) (
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))
}
if args.TabletHostName != "" {
vt.ExtraArgs = append(vt.ExtraArgs, []string{"--tablet_hostname", args.TabletHostName}...)
Expand Down

0 comments on commit 448563a

Please sign in to comment.