Skip to content

HDDS-15067. Complete Multipart upload#10164

Open
YutaLin wants to merge 4 commits intoapache:masterfrom
YutaLin:HDDS-15067_CompleteMultipartUpload
Open

HDDS-15067. Complete Multipart upload#10164
YutaLin wants to merge 4 commits intoapache:masterfrom
YutaLin:HDDS-15067_CompleteMultipartUpload

Conversation

@YutaLin
Copy link
Copy Markdown
Contributor

@YutaLin YutaLin commented Apr 30, 2026

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)

@YutaLin
Copy link
Copy Markdown
Contributor Author

YutaLin commented Apr 30, 2026

Hi @peterxcli @ivandika3
Could you review this? Appreciate!

@peterxcli peterxcli requested review from ivandika3 and peterxcli May 1, 2026 09:11
Copy link
Copy Markdown
Member

@peterxcli peterxcli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@peterxcli
Copy link
Copy Markdown
Member

@YutaLin could you also help me to take a look if we need to clear the etag field and expected data gen field?

omKeyInfo.setExpectedDataGeneration(null);
omKeyInfo.setExpectedETag(null);

@peterxcli
Copy link
Copy Markdown
Member

@YutaLin please re-request my review if think this is ready, thanks!

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.

2 participants