-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
call fsync between part file write and rename #13652
Conversation
beacon-chain/db/filesystem/blob.go
Outdated
@@ -155,6 +155,9 @@ func (bs *BlobStorage) Save(sidecar blocks.VerifiedROBlob) error { | |||
if err != nil { | |||
return err | |||
} | |||
if err := partialFile.Sync(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is closed already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm -- that makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no you're right, fixed.
43bbe7b
to
0f907da
Compare
0f907da
to
6029ac0
Compare
6029ac0
to
c0b5302
Compare
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com> (cherry picked from commit 70e1b11)
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This PR adds a feature flag
--blob-save-fsync
. When this flag is set, the blob storage code will call fsync after writing blob data to the.part
file, before renaming the part file to the.ssz
file.This can be used by node operators who want extra reassurance that zero-length blob files won't be written, particularly in the event of a node restart.