do not add new volumes when below minFreeSpacePercent

fix https://github.com/chrislusf/seaweedfs/issues/2017
This commit is contained in:
Chris Lu 2021-04-21 23:11:09 -07:00
parent 7deb4b20cd
commit ca998328c2

View file

@ -106,6 +106,9 @@ func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation) {
if diskType != location.DiskType {
continue
}
if location.isDiskSpaceLow {
continue
}
currentFreeCount := location.MaxVolumeCount - location.VolumesLen()
currentFreeCount *= erasure_coding.DataShardsCount
currentFreeCount -= location.EcVolumesLen()