Files
kopia/repo
Julio López 8ec295eddd fix(providers): sync file in FS provider to ensure data is persisted (#5150)
Ensures the data is written to persistent storage before closing
the file.

- This prevents silently ignoring async I/O error that occur after
  the file handle has been closed, and thus not observed by the
  kopia process.

- This prevents data loss cases of a client or server host crash where
  the file metadata was already persisted and the actual file data was
  not persisted yet. The actual behavior depends on the specific OS and
  file system implementation.  For example, if no data has been written
  (flushed) to the device, the file size (metadata) may be 0, even after
  the subsequent rename.

Either case above results in a potential repo corruption or data loss.
These cases may occur more frequently with file systems accessed over
the network, for example via NFS.

Behavior change: a `Sync()` failure now aborts the write before close/
rename, so callers will see errors where previously the operation might
have appeared successful, but risked silent data loss.
2026-02-10 21:07:48 -08:00
..
2025-11-17 16:42:12 -08:00
2019-05-27 15:48:39 -07:00