From d237ef0c83357264c294d98815ac5080507764a6 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Fri, 25 Oct 2024 15:00:32 +0200 Subject: [PATCH] set concurrency Signed-off-by: Tim Vaillancourt --- go/vt/topo/shard.go | 3 ++- go/vt/vtorc/logic/tablet_discovery.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go/vt/topo/shard.go b/go/vt/topo/shard.go index 4887f99ee45..ff61928aea6 100644 --- a/go/vt/topo/shard.go +++ b/go/vt/topo/shard.go @@ -646,11 +646,12 @@ func (ts *Server) GetTabletsByShardCell(ctx context.Context, keyspace, shard str mutex := sync.Mutex{} rec := concurrency.AllErrorRecorder{} tablets := make([]*TabletInfo, 0) + concurrency := DefaultConcurrency / len(cells) for _, cell := range cells { wg.Add(1) go func() { t, err := ts.GetTabletsByCell(ctx, cell, &GetTabletsByCellOptions{ - Concurrency: 1, + Concurrency: concurrency, Keyspace: keyspace, Shard: shard, }) diff --git a/go/vt/vtorc/logic/tablet_discovery.go b/go/vt/vtorc/logic/tablet_discovery.go index 34e39cf99c5..e9bbcee35cb 100644 --- a/go/vt/vtorc/logic/tablet_discovery.go +++ b/go/vt/vtorc/logic/tablet_discovery.go @@ -155,7 +155,7 @@ func refreshTabletsUsing(loader func(tabletAlias string), forceRefresh bool) { } func refreshTabletsInCell(ctx context.Context, cell string, loader func(tabletAlias string), forceRefresh bool) { - tablets, err := ts.GetTabletsByCell(ctx, cell, &topo.GetTabletsByCellOptions{Concurrency: 1}) + tablets, err := ts.GetTabletsByCell(ctx, cell, &topo.GetTabletsByCellOptions{Concurrency: topo.DefaultConcurrency}) if err != nil { log.Errorf("Error fetching topo info for cell %v: %v", cell, err) return