mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
core/rawdb: fix incorrect fsync ordering for index file truncation (#34728)
This commit is contained in:
parent
4c03a0631e
commit
573d94013c
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue