-
Notifications
You must be signed in to change notification settings - Fork 361
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
Make transaction log commit with filesystem storage backend to be atomic #126
Conversation
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.
I've got several concern here
- If
rename
fails due to concurrent commits, it'll start over again with incremented version which means that we'll have it writes tmp file again and again. However the impact will be on higher level withintry_commit_loop
which is out of backend storage lvl. - Current impl does not remove tmp files once it fails, but this should be added/revised once previous concern is resolved
…Path> to rename call, add map_err calls for unhanlded unwrap
The rest looks good to me 👍 just need to fix that build issue :D |
…of making input paths absolute ourselves
@mosyp - Regarding 1 you mentioned above, I'll create a separate issue for that problem. Ultimately, we need to expose a
|
@xianwill yes, that's a good idea to move it out of this scope. I feel like once we're done with s3 atomic rename, then we're safe to create some abstraction which will work for both fs and s3 |
Posted #135 |
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.
great work @mosyp !
@xianwill want to take a final look before we merge? |
LGTM! Great work @mosyp! |
Description
This PR makes transaction log commit by writing file in
put_obj
first in temporary file and once that successful then uses atomic rename (with checking on destination existence) to move temporary file into final commit file.Related Issue(s)
Fixes #94
Documentation
renameat2
https://man7.org/linux/man-pages/man2/rename.2.htmlrenamex_np
https://www.unix.com/man-page/mojave/2/renamex_np/