Skip to content

Commit dd80c51

Browse files
authored
Merge pull request #2690 from CortexFoundation/dev
core/rawdb: fix incorrect fsync ordering for index file truncation
2 parents 7d9dc31 + dd8b41b commit dd80c51

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

core/rawdb/freezer_utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ func copyFrom(srcPath, destPath string, offset uint64, before func(f *os.File) e
7676
// we do the final move.
7777
src.Close()
7878

79+
// Permanently persist the content into disk
80+
if err := f.Sync(); err != nil {
81+
return err
82+
}
83+
7984
if err := f.Close(); err != nil {
8085
return err
8186
}

0 commit comments

Comments
 (0)