[ 
https://issues.apache.org/jira/browse/HDDS-15167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153872#comment-18153872
 ] 

Chu Cheng Li commented on HDDS-15167:
-------------------------------------

[~gargijaiswal] Thanks for asking. From my memory, the existing patch has two 
parts:

1. Try to correctly catch the 409 and 412 errors that match the semantic 
documentation on AWS S3.

!image-2026-12-02-16-20-53-564.png|width=100%!

2. Make `preExecute` check for the conditional header too, for an earlier 
return.

But I found it's hard to define what "conflicting operation occurs" really 
means, and making `preExecute` check only has a benefit when there are many 
concurrent in-flight requests, but it adds code complexity.

But yes, please feel free to try.

> Broaden commit conflict detection for conditional writes
> --------------------------------------------------------
>
>                 Key: HDDS-15167
>                 URL: https://issues.apache.org/jira/browse/HDDS-15167
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: OM, s3gateway
>            Reporter: Chu Cheng Li
>            Assignee: Chu Cheng Li
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2026-12-02-16-20-53-564.png
>
>
> 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: 
> [docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html|https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html]
> {quote}[If-Match|https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html#API_CompleteMultipartUpload_RequestSyntax]
> 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.*
> {quote}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to