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
avoid double counting ec slot
Chris Lu717ec47fa2ba
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.goindex 1e9d962127..cdd687d130 100644--- a/weed/shell/command_ec_common.go+++ b/weed/shell/command_ec_common.go@@ -156,7 +156,7 @@ func countShards(ecShardInfos []*master_pb.VolumeEcShardInformationMessage) (cou}func countFreeShardSlots(dn *master_pb.DataNodeInfo) (count int) {- return int(dn.FreeVolumeCount)*erasure_coding.DataShardsCount - countShards(dn.EcShardInfos)+ return int(dn.MaxVolumeCount-dn.ActiveVolumeCount)*erasure_coding.DataShardsCount - countShards(dn.EcShardInfos)}type RackId string@@ -191,15 +191,15 @@ func collectEcNodes(ctx context.Context, commandEnv *CommandEnv, selectedDataCenif selectedDataCenter != "" && selectedDataCenter != dc {return}- if freeEcSlots := countFreeShardSlots(dn); freeEcSlots > 0 {- ecNodes = append(ecNodes, &EcNode{- info: dn,- dc: dc,- rack: rack,- freeEcSlot: int(freeEcSlots),- })- totalFreeEcSlots += freeEcSlots- }++ freeEcSlots := countFreeShardSlots(dn)+ ecNodes = append(ecNodes, &EcNode{+ info: dn,+ dc: dc,+ rack: rack,+ freeEcSlot: int(freeEcSlots),+ })+ totalFreeEcSlots += freeEcSlots})sortEcNodes(ecNodes)