YutaLin commented on PR #10164:
URL: https://github.com/apache/ozone/pull/10164#issuecomment-4367399185

   > @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](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.**
   
   Hi @peterxcli
   Conditional Request conflict can't happen because MPU completion uses 
pessimistic lock, meaning there's no race window between validation and commit.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to