mirror of https://github.com/ethereum/go-ethereum
core/rawdb: fsync head data file before closing it (#26490)
This PR fixes an issue which might result in data lost in freezer. Whenever mutation happens in freezer, all data will be written into head data file and it will be rotated with a new one in case the size of file reaches the threshold. Theoretically, the rotated old data file should be fsync'd to prevent data loss. In freezer.Sync function, we only fsync: (1) index file (2) meta file and (3) head data file. So this PR forcibly fsync the head data file if mutation happens in the boundary of data file.pull/26497/head
parent
a21e963ac2
commit
e04d63ebd3
Loading…
Reference in new issue