mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
lib/storage: take into account -storage.minFreeDiskSpaceBytes
when performing big merges
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/269
This commit is contained in:
parent
120fedf1ac
commit
71c0f7cce3
1 changed files with 4 additions and 0 deletions
|
@ -978,6 +978,10 @@ func SetFinalMergeDelay(delay time.Duration) {
|
||||||
|
|
||||||
func getMaxOutBytes(path string, workersCount int) uint64 {
|
func getMaxOutBytes(path string, workersCount int) uint64 {
|
||||||
n := fs.MustGetFreeSpace(path)
|
n := fs.MustGetFreeSpace(path)
|
||||||
|
if n < freeDiskSpaceLimitBytes {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
n -= freeDiskSpaceLimitBytes
|
||||||
// Divide free space by the max number concurrent merges.
|
// Divide free space by the max number concurrent merges.
|
||||||
maxOutBytes := n / uint64(workersCount)
|
maxOutBytes := n / uint64(workersCount)
|
||||||
if maxOutBytes > maxBigPartSize {
|
if maxOutBytes > maxBigPartSize {
|
||||||
|
|
Loading…
Reference in a new issue