-
Notifications
You must be signed in to change notification settings - Fork 21.6k
core/rawdb: avoid O_APPEND #19676
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
core/rawdb: avoid O_APPEND #19676
Conversation
holiman
left a comment
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.
LGTM
| } | ||
|
|
||
| // openFreezerFile opens a freezer table file and seeks to the end | ||
| func openFreezerFileForAppend(filename string) (*os.File, error) { |
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.
Nitpick, please fix the comments so they reference the correct method (on this and the 2 methods below).
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.
And in general, please leave an empty space after the // characters within the method comments.
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.
And please capitalize min-method comments :)
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.
lol, well spotted. thanks, and done :-)
karalabe
left a comment
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.
SGTM
Fixes freezer on Windows.
Summary:
The O_APPEND flag in the Go implementation for windows removes the rights to truncate a file.
A workaround was implemented where O_APPEND was avoided, but writes force a Seek to end of file.