mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/storage: do not create flock.lock files at partition directories, since it is created at the Storage level
This commit is contained in:
parent
0f01eea4e9
commit
aeac39cfd1
1 changed files with 0 additions and 12 deletions
|
@ -2,7 +2,6 @@ package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -25,8 +24,6 @@ type table struct {
|
||||||
ptws []*partitionWrapper
|
ptws []*partitionWrapper
|
||||||
ptwsLock sync.Mutex
|
ptwsLock sync.Mutex
|
||||||
|
|
||||||
flockF *os.File
|
|
||||||
|
|
||||||
stop chan struct{}
|
stop chan struct{}
|
||||||
|
|
||||||
retentionWatcherWG sync.WaitGroup
|
retentionWatcherWG sync.WaitGroup
|
||||||
|
@ -85,9 +82,6 @@ func mustOpenTable(path string, s *Storage) *table {
|
||||||
// Create a directory for the table if it doesn't exist yet.
|
// Create a directory for the table if it doesn't exist yet.
|
||||||
fs.MustMkdirIfNotExist(path)
|
fs.MustMkdirIfNotExist(path)
|
||||||
|
|
||||||
// Protect from concurrent opens.
|
|
||||||
flockF := fs.MustCreateFlockFile(path)
|
|
||||||
|
|
||||||
// Create directories for small and big partitions if they don't exist yet.
|
// Create directories for small and big partitions if they don't exist yet.
|
||||||
smallPartitionsPath := filepath.Join(path, smallDirname)
|
smallPartitionsPath := filepath.Join(path, smallDirname)
|
||||||
fs.MustMkdirIfNotExist(smallPartitionsPath)
|
fs.MustMkdirIfNotExist(smallPartitionsPath)
|
||||||
|
@ -114,8 +108,6 @@ func mustOpenTable(path string, s *Storage) *table {
|
||||||
bigPartitionsPath: bigPartitionsPath,
|
bigPartitionsPath: bigPartitionsPath,
|
||||||
s: s,
|
s: s,
|
||||||
|
|
||||||
flockF: flockF,
|
|
||||||
|
|
||||||
stop: make(chan struct{}),
|
stop: make(chan struct{}),
|
||||||
}
|
}
|
||||||
for _, pt := range pts {
|
for _, pt := range pts {
|
||||||
|
@ -197,10 +189,6 @@ func (tb *table) MustClose() {
|
||||||
}
|
}
|
||||||
ptw.decRef()
|
ptw.decRef()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release exclusive lock on the table.
|
|
||||||
fs.MustClose(tb.flockF)
|
|
||||||
tb.flockF = nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// flushPendingRows flushes all the pending raw rows, so they become visible to search.
|
// flushPendingRows flushes all the pending raw rows, so they become visible to search.
|
||||||
|
|
Loading…
Reference in a new issue