fix: freezer incorrect fsync ordering so that the temp file fsync happens before the rename

This commit is contained in:
Snehendu Roy 2026-04-15 18:25:15 +05:30
parent ef0f1f96f9
commit bc0397fe9f
No known key found for this signature in database

View file

@ -76,6 +76,11 @@ func copyFrom(srcPath, destPath string, offset uint64, before func(f *os.File) e
// we do the final move.
src.Close()
// Permanently persist the content into disk
if err := f.Sync(); err != nil {
return err
}
if err := f.Close(); err != nil {
return err
}