From 573d94013c92cec161f23aef1d74549dcb236ae1 Mon Sep 17 00:00:00 2001 From: Snehendu Roy <81818503+snehendu098@users.noreply.github.com> Date: Fri, 17 Apr 2026 17:15:03 +0530 Subject: [PATCH] core/rawdb: fix incorrect fsync ordering for index file truncation (#34728) --- 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 }