-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Ignore abort-on-cleanup failure in S3 repo #138569
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
Ignore abort-on-cleanup failure in S3 repo #138569
Conversation
If a `CompleteMultipartUpload` request fails then we attempt to clean up by calling the `AbortMultipartUpload` API. This cleanup may also fail, and a failure here will supersede the original failure. The cleanup is really a best-effort thing so we should ignore failures. In particular if the `CompleteMultipartUpload` has an `If-None-Match` precondition then this may fail with a `409 Conflict` and in that case the upload no longer exists, so we would expect the `AbortMultipartUpload` call to fail with a 404. This commit extends `S3HttpHandler` to respond with both 412 and 409s on precondition failures, cleaning up the upload on a 409 but not a 412, triggering the unwanted failure path in some tests, and adds exception handling to deal with it.
|
Hi @DaveCTurner, I've created a changelog YAML for you. |
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
|
Hey, this change partially includes changes from #138542. Is it to be merged first or second? |
|
This one goes in first, fixing the missing exception handling, then #138542 will just be about adding the |
joshua-adams-1
left a comment
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.
LGTM
If a `CompleteMultipartUpload` request fails then we attempt to clean up by calling the `AbortMultipartUpload` API. This cleanup may also fail, and a failure here will supersede the original failure. The cleanup is really a best-effort thing so we should ignore failures. In particular if the `CompleteMultipartUpload` has an `If-None-Match` precondition then this may fail with a `409 Conflict` and in that case the upload no longer exists, so we would expect the `AbortMultipartUpload` call to fail with a 404. This commit extends `S3HttpHandler` to respond with both 412 and 409s on precondition failures, cleaning up the upload on a 409 but not a 412, triggering the unwanted failure path in some tests, and adds exception handling to deal with it.
If a
CompleteMultipartUploadrequest fails then we attempt to clean upby calling the
AbortMultipartUploadAPI. This cleanup may also fail,and a failure here will supersede the original failure. The cleanup is
really a best-effort thing so we should ignore failures. In particular
if the
CompleteMultipartUploadhas anIf-None-Matchpreconditionthen this may fail with a
409 Conflictand in that case the upload nolonger exists, so we would expect the
AbortMultipartUploadcall tofail with a 404.
This commit extends
S3HttpHandlerto respond with both 412 and 409s onprecondition failures, cleaning up the upload on a 409 but not a 412,
triggering the unwanted failure path in some tests, and adds exception
handling to deal with it.