From bc0397fe9f23641b766536a821d53174b7919c53 Mon Sep 17 00:00:00 2001 From: Snehendu Roy Date: Wed, 15 Apr 2026 18:25:15 +0530 Subject: [PATCH] fix: freezer incorrect fsync ordering so that the temp file fsync happens before the rename --- core/rawdb/freezer_utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/rawdb/freezer_utils.go b/core/rawdb/freezer_utils.go index 7f1a978b63..eb9aeab451 100644 --- a/core/rawdb/freezer_utils.go +++ b/core/rawdb/freezer_utils.go @@ -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 }