-
Notifications
You must be signed in to change notification settings - Fork 2
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
fsync parent also after rename #8
Comments
Hi, yes, this change has already been made and will be part of the next
release:
7da14cb
For context: when I first made this crate, I thought that it would be the
caller responsibility to sync the directory if they wanted to (there are
some cases where they might not want to; for example when writing multiple
files, in which case it makes sense to sync the directory only once at the
end). And so I omitted that call to save a syscall. However, I later
realized that callers might not be aware or want to deal with such low
level details, and so I added the call.
Thanks for reporting this. I'll close the issue once the release is made.
…On Tue, May 14, 2024, 17:10 Radu Marias ***@***.***> wrote:
After reading more I found it's recommended to fsync parent also to be
sure data is persisted ok.
You can see here more
https://www.quora.com/Linux/When-should-you-fsync-the-containing-directory-in-addition-to-the-file-itself
Also I see other implementations are doing it
https://github.com/untitaker/rust-atomicwrites/blob/master/src/lib.rs#L200
It's not a bit deal, I can fsync parent after commit but would be nice to
have this included
—
Reply to this email directly, view it on GitHub
<#8>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACOKLXNKN4Q4B4OARDLP53ZCKRVZAVCNFSM6AAAAABHXDVGE2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TMNRRGA3TQMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
sure thing, great job 👍
On Wed, May 15, 2024, 04:40 Andrea Corbellini ***@***.***>
wrote:
… Hi, yes, this change has already been made and will be part of the next
release:
7da14cb
For context: when I first made this crate, I thought that it would be the
caller responsibility to sync the directory if they wanted to (there are
some cases where they might not want to; for example when writing multiple
files, in which case it makes sense to sync the directory only once at the
end). And so I omitted that call to save a syscall. However, I later
realized that callers might not be aware or want to deal with such low
level details, and so I added the call.
Thanks for reporting this. I'll close the issue once the release is made.
On Tue, May 14, 2024, 17:10 Radu Marias ***@***.***> wrote:
> After reading more I found it's recommended to fsync parent also to be
> sure data is persisted ok.
> You can see here more
>
https://www.quora.com/Linux/When-should-you-fsync-the-containing-directory-in-addition-to-the-file-itself
> Also I see other implementations are doing it
>
https://github.com/untitaker/rust-atomicwrites/blob/master/src/lib.rs#L200
>
> It's not a bit deal, I can fsync parent after commit but would be nice
to
> have this included
>
> —
> Reply to this email directly, view it on GitHub
> <#8>,
or
> unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AACOKLXNKN4Q4B4OARDLP53ZCKRVZAVCNFSM6AAAAABHXDVGE2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TMNRRGA3TQMA>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5TC4CWAAZZQ7VLEMOJXA3ZCK4IXAVCNFSM6AAAAABHXDVGE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJRGQZDMOJRGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After reading more I found it's recommended to fsync parent also to be sure data is persisted ok.
You can see here more https://www.quora.com/Linux/When-should-you-fsync-the-containing-directory-in-addition-to-the-file-itself
Also I see other implementations are doing it https://github.com/untitaker/rust-atomicwrites/blob/master/src/lib.rs#L200
It's not a bit deal, I can fsync parent after commit but would be nice to have this included
The text was updated successfully, but these errors were encountered: