feat(shell): parallelize volume balance moves (#10737)

* chore: volume.balance parallelization

* chore: volume.balance add ioBytePerSecond

---------

Co-authored-by: Konstantin Lebedev <whitefox@mayflower.work>
This commit is contained in:
Konstantin Lebedev
2026-08-13 19:11:38 -07:00
committed by GitHub
co-authored by Konstantin Lebedev
parent 0de7ff5eb8
commit 9386a25a4a
5 changed files with 485 additions and 113 deletions
+11 -11
View File
@@ -1008,19 +1008,19 @@ func (ecb *ecBalancer) executePhase(byID map[string]*EcNode, moves []ecbalancer.
}
byVol[m.VolumeID] = append(byVol[m.VolumeID], m)
}
ewg := NewErrorWaitGroup(ecb.maxParallelization)
taskGroups := make([][]ErrorWaitGroupTask, 0, len(order))
for _, vid := range order {
group := byVol[vid]
ewg.Add(func() error {
for _, m := range group {
if err := ecb.executeMove(byID, m); err != nil {
return err
}
}
return nil
})
movesForVolume := byVol[vid]
taskGroup := make([]ErrorWaitGroupTask, 0, len(movesForVolume))
for _, move := range movesForVolume {
move := move
taskGroup = append(taskGroup, func() error {
return ecb.executeMove(byID, move)
})
}
taskGroups = append(taskGroups, taskGroup)
}
return ewg.Wait()
return executeParallelTaskGroups(ecb.maxParallelization, taskGroups)
}
// verifyEcShardOnKeepNode confirms the node a dedup move chose to keep actually