volume: add default minFreeSpacePercent

fix https://github.com/chrislusf/seaweedfs/issues/1366
This commit is contained in:
Chris Lu 2020-06-21 08:44:06 -07:00
parent e7c36f740a
commit 98493e0152

View file

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