aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weed/shell/command_volume_balance.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go
index ac7dab3d9..b3c76a172 100644
--- a/weed/shell/command_volume_balance.go
+++ b/weed/shell/command_volume_balance.go
@@ -225,7 +225,11 @@ func capacityByMaxVolumeCount(diskType types.DiskType) CapacityFunc {
if !found {
return 0
}
- return float64(diskInfo.MaxVolumeCount)
+ var ecShardCount int
+ for _, ecShardInfo := range diskInfo.EcShardInfos {
+ ecShardCount += erasure_coding.ShardBits(ecShardInfo.EcIndexBits).ShardIdCount()
+ }
+ return float64(diskInfo.MaxVolumeCount) - float64(ecShardCount)/erasure_coding.DataShardsCount
}
}