From 5a4a8c98381634a43280059e436d25f9ac5c156b Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 17 May 2023 09:19:01 +0200 Subject: [PATCH] txthrottler: further code cleanup (#12902) * txthrottler: further code cleanup Signed-off-by: Tim Vaillancourt * Fix bad merge resolution Signed-off-by: Tim Vaillancourt --------- Signed-off-by: Tim Vaillancourt --- go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go index 6fd0bddb5d2..03658790ebb 100644 --- a/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go +++ b/go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go @@ -249,7 +249,7 @@ func (t *txThrottler) Open() (err error) { } log.Info("txThrottler: opening") t.throttlerRunning.Set(1) - t.state, err = newTxThrottlerState(t.topoServer, t.config, t.target.Keyspace, t.target.Shard, t.target.Cell) + t.state, err = newTxThrottlerState(t.topoServer, t.config, t.target) return err } @@ -294,7 +294,7 @@ func (t *txThrottler) Throttle(priority int) (result bool) { return result } -func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, keyspace, shard, cell string) (*txThrottlerState, error) { +func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, target *querypb.Target) (*txThrottlerState, error) { maxReplicationLagModuleConfig := throttler.MaxReplicationLagModuleConfig{Configuration: config.throttlerConfig} t, err := throttlerFactory( @@ -325,8 +325,8 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, key topoServer, result.healthCheck, /* LegacyTabletRecorder */ cell, - keyspace, - shard, + target.Keyspace, + target.Shard, discovery.DefaultTopologyWatcherRefreshInterval, discovery.DefaultTopoReadConcurrency)) }