mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 00:26:36 +03:00
lib/backup/fsremote/fsremote.go: remove unneeded fsync for the hard-linked file
The source file contents should be already fsynced to disk before creating a hard link, so there is no sense in calling fsync() on the created hard link.
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/common"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/fscommon"
|
||||
libfs "github.com/VictoriaMetrics/VictoriaMetrics/lib/fs"
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
||||
)
|
||||
|
||||
@@ -103,7 +102,7 @@ func (fs *FS) CopyPart(srcFS common.OriginFS, p common.Part) error {
|
||||
}
|
||||
// Attempt to create hardlink from srcPath to dstPath.
|
||||
if err := os.Link(srcPath, dstPath); err == nil {
|
||||
libfs.MustSyncPath(dstPath)
|
||||
// There is no need in fsync for dstPath, since its contents must be already synced at srcPath.
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user