From 57277ed6bcfd2116f82ea1ad6cabe15006f92274 Mon Sep 17 00:00:00 2001 From: Roman Khavronenko Date: Fri, 6 Jan 2023 03:30:42 +0100 Subject: [PATCH] vmstorage: add more context to the flock acquiring msg (#3584) See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3578 Signed-off-by: hagen1778 Signed-off-by: hagen1778 --- lib/mergeset/table.go | 3 ++- lib/storage/storage.go | 3 ++- lib/storage/table.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/mergeset/table.go b/lib/mergeset/table.go index 6945024672..cb875c0269 100644 --- a/lib/mergeset/table.go +++ b/lib/mergeset/table.go @@ -316,7 +316,8 @@ func OpenTable(path string, flushCallback func(), prepareBlock PrepareBlockCallb // Protect from concurrent opens. flockF, err := fs.CreateFlockFile(path) if err != nil { - return nil, err + return nil, fmt.Errorf("cannot create lock file in %q; "+ + "make sure the dir isn't used by other processes or manually delete the file if you recover from abrupt VictoriaMetrics crash; error: %w", path, err) } // Open table parts. diff --git a/lib/storage/storage.go b/lib/storage/storage.go index 5503708430..702628d2ad 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -187,7 +187,8 @@ func OpenStorage(path string, retentionMsecs int64, maxHourlySeries, maxDailySer // Protect from concurrent opens. flockF, err := fs.CreateFlockFile(path) if err != nil { - return nil, err + return nil, fmt.Errorf("cannot create lock file in %q; "+ + "make sure the dir isn't used by other processes or manually delete the file if you recover from abrupt VictoriaMetrics crash; error: %w", path, err) } s.flockF = flockF diff --git a/lib/storage/table.go b/lib/storage/table.go index 5eca5e4a3a..690d21715f 100644 --- a/lib/storage/table.go +++ b/lib/storage/table.go @@ -90,7 +90,8 @@ func openTable(path string, s *Storage) (*table, error) { // Protect from concurrent opens. flockF, err := fs.CreateFlockFile(path) if err != nil { - return nil, err + return nil, fmt.Errorf("cannot create lock file in %q; "+ + "make sure the dir isn't used by other processes or manually delete the file if you recover from abrupt VictoriaMetrics crash; error: %w", path, err) } // Create directories for small and big partitions if they don't exist yet.