mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-08 05:34:44 +08:00
fix: consider EC shard count in volume.balance capacity calculation (#7034)
* fix: consider EC shard count in volume.balance capacity calculation * update the implementation of capacityByMaxVolumeCount to include the EC shard usage
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user