From 50f934aafbf19f756caafad4c16647136599e1e1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 13 Jun 2026 13:10:36 -0700 Subject: [PATCH] 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. --- weed/server/volume_grpc_tier_download.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weed/server/volume_grpc_tier_download.go b/weed/server/volume_grpc_tier_download.go index 4376abae2..3097cc3d6 100644 --- a/weed/server/volume_grpc_tier_download.go +++ b/weed/server/volume_grpc_tier_download.go @@ -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