SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
Parallelize EC shards balancing across racks. (#6352)
Lisandro Pin926cfea3dca8
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.goindex c385186649..fff3db429f 100644--- a/weed/shell/command_ec_common.go+++ b/weed/shell/command_ec_common.go@@ -679,17 +679,18 @@ func (ecb *ecBalancer) doDeduplicateEcShards(collection string, vid needle.Volumreturn nil}-// TODO: enable parallelizationfunc (ecb *ecBalancer) balanceEcShardsAcrossRacks(collection string) error {// collect vid => []ecNode, since previous steps can change the locationsvidLocations := ecb.collectVolumeIdToEcNodes(collection)+// spread the ec shards evenly+ ecb.wgInit()for vid, locations := range vidLocations {- if err := ecb.doBalanceEcShardsAcrossRacks(collection, vid, locations); err != nil {- return err- }+ ecb.wgAdd(func() error {+ return ecb.doBalanceEcShardsAcrossRacks(collection, vid, locations)+ })}- return nil+ return ecb.wgWait()}func countShardsByRack(vid needle.VolumeId, locations []*EcNode) map[string]int {