Skip to content

Commit

Permalink
set concurrency
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Oct 25, 2024
1 parent bce3640 commit d237ef0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion go/vt/topo/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtorc/logic/tablet_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d237ef0

Please sign in to comment.