From 98493e01524f222a93eee26afe3dc2540f5be761 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 21 Jun 2020 08:44:06 -0700 Subject: [PATCH] volume: add default minFreeSpacePercent fix https://github.com/chrislusf/seaweedfs/issues/1366 --- weed/command/volume.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/command/volume.go b/weed/command/volume.go index a8025b56f..8eed851b0 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -142,6 +142,11 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v glog.Fatalf("The value specified in -minFreeSpacePercent not a valid value %s", freeString) } } + if len(v.minFreeSpacePercent) == 1 && len(v.folders) > 1 { + for i := 0; i < len(v.folders)-1; i++ { + v.minFreeSpacePercent = append(v.minFreeSpacePercent, v.minFreeSpacePercent[0]) + } + } if len(v.folders) != len(v.minFreeSpacePercent) { glog.Fatalf("%d directories by -dir, but only %d minFreeSpacePercent is set by -minFreeSpacePercent", len(v.folders), len(v.minFreeSpacePercent)) }