HDDS-15067. Conditional CompleteMultipartUpload#10164
HDDS-15067. Conditional CompleteMultipartUpload#10164YutaLin wants to merge 4 commits intoapache:masterfrom
Conversation
|
Hi @peterxcli @ivandika3 |
peterxcli
left a comment
There was a problem hiding this comment.
@YutaLin Thanks for the patch, left some comments, the rest looks good.
By the way, could you help me reason about how we can return a 409 in the presence of concurrent requests? Specifically, if two or more independent clients send the exact same Complete Multipart Upload request at the same time, only one client should receive a successful response and the others should get a 409. That way, they know they must re-read the object, re-upload the parts if necessary, and then complete the MPU again using the latest ETag they observed.
ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html
If-Match
Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a 412 Precondition Failed error.If a conflicting operation occurs during the upload S3 returns a 409 ConditionalRequestConflict response. On a 409 failure you should fetch the object's ETag, re-initiate the multipart upload with CreateMultipartUpload, and re-upload each part.
|
@YutaLin could you also help me to take a look if we need to clear the etag field and expected data gen field? |
|
@YutaLin please re-request my review if think this is ready, thanks! |
What changes were proposed in this pull request?
Conditional CompleteMultipartUpload
Please describe your PR in detail:
Conditional MPU completion should reuse the same conditional write fields already present in KeyArgs, but unlike normal conditional PUT, it does not need an open-key plus later commit bridge. The final key is assembled and committed inside one OM transaction in S3MultipartUploadCompleteRequest.validateAndUpdateCache(...) while holding the normal bucket write lock
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15067
How was this patch tested?
Add E2E tests, CI Action(https://github.com/YutaLin/ozone/actions/runs/25147780358)