Skip to content
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

OSX: fsync does not have the same effect as on Linux #539

Open
ysmolski opened this issue Aug 9, 2019 · 0 comments
Open

OSX: fsync does not have the same effect as on Linux #539

ysmolski opened this issue Aug 9, 2019 · 0 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.

Comments

@ysmolski
Copy link
Member

ysmolski commented Aug 9, 2019

On some OSX fsync does not affect performance that much. I was staggered by this and started looking. What I have found:

For applications that require tighter guarantees about the integrity of
their data, Mac OS X provides the F_FULLFSYNC fcntl. The F_FULLFSYNC
fcntl asks the drive to flush all buffered data to permanent storage.
Applications, such as databases, that require a strict ordering of writes
should use F_FULLFSYNC to ensure that their data is written in the order
they expect.

https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fsync.2.html

fsync usage on OSX should be replaced with fcntl(fd, F_FULLFSYNC, 0) if F_FULLFSYNC is defined, otherwise fallback to 'fsync'.

@ysmolski ysmolski added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

1 participant