mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 00:26:36 +03:00
lib/persistentqueue/persistentqueue.go: remove fs.MustSyncPath() call after fs.MustWriteSync()
The fs.MustWriteSync() already fsyncs the created file, so there is no need in additional fsync() call. While at it, add missing fsync for the parent directory after creating a directory for persistent queue.
This commit is contained in:
@@ -178,6 +178,7 @@ func tryOpeningQueue(path, name string, chunkFileSize, maxBlockSize, maxPendingB
|
||||
fs.MustClose(q.flockF)
|
||||
}
|
||||
}()
|
||||
fs.MustSyncPathAndParentDir(path)
|
||||
|
||||
// Read metainfo.
|
||||
var mi metainfo
|
||||
@@ -643,7 +644,6 @@ func (mi *metainfo) WriteToFile(path string) error {
|
||||
return fmt.Errorf("cannot marshal persistent queue metainfo %#v: %w", mi, err)
|
||||
}
|
||||
fs.MustWriteSync(path, data)
|
||||
fs.MustSyncPath(path)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user