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

Abort upload on out-of-order writes #341

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

passaro
Copy link
Contributor

@passaro passaro commented Jun 30, 2023

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).

@passaro passaro had a problem deploying to PR integration tests June 30, 2023 14:49 — with GitHub Actions Failure
@passaro passaro had a problem deploying to PR integration tests June 30, 2023 14:49 — with GitHub Actions Failure
@passaro passaro had a problem deploying to PR integration tests June 30, 2023 14:49 — with GitHub Actions Failure
@passaro passaro had a problem deploying to PR integration tests June 30, 2023 14:49 — with GitHub Actions Failure
@passaro passaro temporarily deployed to PR integration tests June 30, 2023 14:52 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests June 30, 2023 14:52 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests June 30, 2023 14:52 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests June 30, 2023 14:52 — with GitHub Actions Inactive
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
@passaro passaro temporarily deployed to PR integration tests June 30, 2023 15:53 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests June 30, 2023 15:53 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests June 30, 2023 15:53 — with GitHub Actions Inactive
@passaro passaro had a problem deploying to PR integration tests June 30, 2023 15:53 — with GitHub Actions Failure
@passaro passaro changed the title Add fuse test for out-of-order writes Abort upload on out-of-order writes Jun 30, 2023
@passaro passaro marked this pull request as ready for review June 30, 2023 16:04
Comment on lines +367 to +372
// 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));
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@jamesbornholt jamesbornholt merged commit 69d9f90 into awslabs:main Jun 30, 2023
@passaro passaro deleted the out-of-order-write-test branch July 3, 2023 07:22
sauraank pushed a commit to sauraank/mountpoint-s3 that referenced this pull request Jul 3, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants