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

Investigate whether fsync system call is needed for fs backend atomic rename operation #142

Open
houqp opened this issue Mar 20, 2021 · 2 comments
Labels
binding/rust Issues for the Rust crate enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@houqp
Copy link
Member

houqp commented Mar 20, 2021

Rumor has that on Linux one needs to call fsync after temp file has been written out first before calling rename syscall, otherwise we could end up with an empty file in the new location during system crashes.

@houqp houqp added binding/rust Issues for the Rust crate enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Mar 20, 2021
@ryan-johnson-databricks

This is almost certainly true, because rename is a metadata-only operation. However, a call to fdatasync should suffice because rename by virtue of being atomic must anyway sync all metadata needed to find and open the file (or at least, if there's a crash, the rename must have either succeeded or it did not).

@tsafacjo
Copy link

tsafacjo commented Nov 1, 2023

can I take it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/rust Issues for the Rust crate enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants