factor in existing ec volume count when estimating max volume count
related to https://github.com/seaweedfs/seaweedfs/issues/5191
This commit is contained in:
@@ -149,7 +149,7 @@ func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation) {
|
||||
}
|
||||
currentFreeCount := location.MaxVolumeCount - int32(location.VolumesLen())
|
||||
currentFreeCount *= erasure_coding.DataShardsCount
|
||||
currentFreeCount -= int32(location.EcVolumesLen())
|
||||
currentFreeCount -= int32(location.EcShardCount())
|
||||
currentFreeCount /= erasure_coding.DataShardsCount
|
||||
if currentFreeCount > max {
|
||||
max = currentFreeCount
|
||||
|
||||
Reference in New Issue
Block a user