controller: atomicPromoteTar syncs via an O_RDWR handle — read-only fsync is refused on Windows, which kept the dev-box green gate permanently red (Linux behavior unchanged)

Claude-Session: https://claude.ai/code/session_01GzammAMzsJTgpQHqxwM2bC
This commit is contained in:
2026-07-13 08:19:39 +02:00
parent b4e0a197f9
commit 40b53047f1
+3 -1
View File
@@ -553,7 +553,9 @@ func (m *Manager) tarVolumeOrDefault(volName, dumpDir string) ([]byte, error) {
// error the tmp is left for the caller to remove; the final `.tar` is never touched here except by a
// successful rename.
func atomicPromoteTar(tmpPath, finalPath string) error {
f, err := os.Open(tmpPath)
// O_RDWR, not os.Open: fsync on a read-only handle is refused on Windows (dev-box test runs),
// while a writable handle syncs on every platform. Content is not modified.
f, err := os.OpenFile(tmpPath, os.O_RDWR, 0)
if err != nil {
return fmt.Errorf("opening tmp dump: %w", err)
}