aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-04-21 23:11:09 -0700
committerChris Lu <chris.lu@gmail.com>2021-04-21 23:11:11 -0700
commitca998328c2916fdba751fa9add6f8eec626ff0be (patch)
tree264b4fb3ab881208b0770249d13d1fa6e2b9a38a /weed
parent7deb4b20cd08662085f5f2ac92a26a541501b847 (diff)
downloadseaweedfs-ca998328c2916fdba751fa9add6f8eec626ff0be.tar.xz
seaweedfs-ca998328c2916fdba751fa9add6f8eec626ff0be.zip
do not add new volumes when below minFreeSpacePercent
fix https://github.com/chrislusf/seaweedfs/issues/2017
Diffstat (limited to 'weed')
-rw-r--r--weed/storage/store.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/storage/store.go b/weed/storage/store.go
index c3507c0e2..6be15a4c9 100644
--- a/weed/storage/store.go
+++ b/weed/storage/store.go
@@ -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()