add parallel workers in batch replication (#16609)

This commit is contained in:
Harshavardhana
2023-02-13 12:07:58 -08:00
committed by GitHub
parent ee6d96eb46
commit 31188e9327
4 changed files with 108 additions and 70 deletions

View File

@@ -898,8 +898,9 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
defer wg.Done()
err := set.listObjectsToDecommission(ctx, bi,
func(entry metaCacheEntry) {
parallelWorkers <- struct{}{}
// Wait must be synchronized here.
wg.Add(1)
parallelWorkers <- struct{}{}
go decommissionEntry(entry)
},
)