mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-06-13 23:36:45 +03:00
server: skip directory fsync on Windows in the tier download path
os.Open(dir).Sync() is unsupported on Windows and returns an error, which would fail VolumeTierMoveDatFromRemote entirely there. Skip the directory fsync on Windows, matching how the storage-side helper tolerates the unsupported case.
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
|
||||
@@ -121,8 +122,12 @@ func swapToLocalDatBackend(v *storage.Volume, datFileName string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// fsyncDir flushes a directory entry so renamed/created files within it survive a crash.
|
||||
// fsyncDir flushes a directory entry so renamed/created files within it survive
|
||||
// a crash. Directory fsync is unsupported on Windows, so it is skipped there.
|
||||
func fsyncDir(dir string) error {
|
||||
if runtime.GOOS == "windows" {
|
||||
return nil
|
||||
}
|
||||
d, err := os.Open(dir)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user