From aeac39cfd10cce05d12867e3eb8a9974ad0fcefe Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 19 Jun 2023 22:48:37 -0700 Subject: [PATCH] lib/storage: do not create flock.lock files at partition directories, since it is created at the Storage level --- lib/storage/table.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/storage/table.go b/lib/storage/table.go index 4f9a6e84f..29ba9616b 100644 --- a/lib/storage/table.go +++ b/lib/storage/table.go @@ -2,7 +2,6 @@ package storage import ( "fmt" - "os" "path/filepath" "strings" "sync" @@ -25,8 +24,6 @@ type table struct { ptws []*partitionWrapper ptwsLock sync.Mutex - flockF *os.File - stop chan struct{} 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. fs.MustMkdirIfNotExist(path) - // Protect from concurrent opens. - flockF := fs.MustCreateFlockFile(path) - // Create directories for small and big partitions if they don't exist yet. smallPartitionsPath := filepath.Join(path, smallDirname) fs.MustMkdirIfNotExist(smallPartitionsPath) @@ -114,8 +108,6 @@ func mustOpenTable(path string, s *Storage) *table { bigPartitionsPath: bigPartitionsPath, s: s, - flockF: flockF, - stop: make(chan struct{}), } for _, pt := range pts { @@ -197,10 +189,6 @@ func (tb *table) MustClose() { } 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.