core/rawdb: fix incorrect fsync ordering for index file truncation (#34728)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

This commit is contained in:
Snehendu Roy 2026-04-17 17:15:03 +05:30 committed by GitHub
parent 4c03a0631e
commit 573d94013c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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