-
Notifications
You must be signed in to change notification settings - Fork 157
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
Abort upload on out-of-order writes #341
Conversation
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
5281dc0
to
779b1fc
Compare
// The kernel doesn't guarantee to flush the data as soon as the file is closed. Currently, | ||
// the file won't be visible on the file system until it's flushed to S3, and so trying to stat | ||
// the file will fail. | ||
// TODO we can remove this when we implement fsync, or change it when we make files visible | ||
// during writes | ||
std::thread::sleep(Duration::from_secs(5)); |
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 think we can now use fsync?
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.
Not really. A successful fsync guarantees that the file has been uploaded, but not currently that the inode has been updated.
* Add fuse test for out-of-order writes Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk> * Abort upload after an out-of-order write attempt. Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk> --------- Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
Description of change
Out-of-order writes previously failed but would not abort the upload and would even allow to resume writing sequentially.
This change aborts the upload and mark the file handle has failed, so that subsequent operations (e.g. write, fsync) will return an error.
Does this change impact existing behavior?
Yes, the behavior of write when trying to write out-of-order has changed.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).