ec.encode: calculate free ec slots based on (maxVolumeCount-volumeCount)

fix https://github.com/chrislusf/seaweedfs/issues/2642
This commit is contained in:
chrislu 2022-02-08 01:51:13 -08:00
parent 13f6ec1c4e
commit 21aaa4c1f1

View file

@ -172,7 +172,7 @@ func countFreeShardSlots(dn *master_pb.DataNodeInfo, diskType types.DiskType) (c
if diskInfo == nil { if diskInfo == nil {
return 0 return 0
} }
return int(diskInfo.MaxVolumeCount-diskInfo.ActiveVolumeCount)*erasure_coding.DataShardsCount - countShards(diskInfo.EcShardInfos) return int(diskInfo.MaxVolumeCount-diskInfo.VolumeCount)*erasure_coding.DataShardsCount - countShards(diskInfo.EcShardInfos)
} }
type RackId string type RackId string