diff options
| author | chrislu <chris.lu@gmail.com> | 2022-10-09 22:31:30 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-10-09 22:31:30 -0700 |
| commit | 0623bf582ee6dd7f72f45b7953ddf9a8a293433a (patch) | |
| tree | 69056664b43f7931d0c53e52dfd8adf884fc24f3 /weed/shell/command_volume_balance.go | |
| parent | 98dc1e5c15d0a7e3b7c9dc946f360f236d1c9fc4 (diff) | |
| download | seaweedfs-0623bf582ee6dd7f72f45b7953ddf9a8a293433a.tar.xz seaweedfs-0623bf582ee6dd7f72f45b7953ddf9a8a293433a.zip | |
include ec shard for capacityByFreeVolumeCount
Diffstat (limited to 'weed/shell/command_volume_balance.go')
| -rw-r--r-- | weed/shell/command_volume_balance.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go index e13857536..7884fc7a0 100644 --- a/weed/shell/command_volume_balance.go +++ b/weed/shell/command_volume_balance.go @@ -202,7 +202,11 @@ func capacityByFreeVolumeCount(diskType types.DiskType) CapacityFunc { if !found { return 0 } - return float64(diskInfo.MaxVolumeCount - diskInfo.VolumeCount) + var ecShardCount int + for _, ecShardInfo := range diskInfo.EcShardInfos { + ecShardCount += erasure_coding.ShardBits(ecShardInfo.EcIndexBits).ShardIdCount() + } + return float64(diskInfo.MaxVolumeCount-diskInfo.VolumeCount) - float64(ecShardCount)/erasure_coding.DataShardsCount } } |
