mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 18:47:55 +08:00
include ec shard for capacityByFreeVolumeCount
This commit is contained in:
@@ -202,7 +202,11 @@ func capacityByFreeVolumeCount(diskType types.DiskType) CapacityFunc {
|
|||||||
if !found {
|
if !found {
|
||||||
return 0
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user