mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-09 03:44:56 +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 {
|
if !found {
|
||||||
return 0
|
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