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:
chrislu
2024-01-11 08:19:09 -08:00
parent a7fc723ae0
commit 050efe6c08
2 changed files with 7 additions and 3 deletions

View File

@@ -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