[ 
https://issues.apache.org/jira/browse/HDDS-14968?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chu Cheng Li updated HDDS-14968:
--------------------------------
    Status: Patch Available  (was: In Progress)

> Differentiate PreconditionFailed and ConditionalRequestConflict in S3 
> Conditional PUT
> -------------------------------------------------------------------------------------
>
>                 Key: HDDS-14968
>                 URL: https://issues.apache.org/jira/browse/HDDS-14968
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: OM, s3gateway
>            Reporter: Chu Cheng Li
>            Assignee: Chu Cheng Li
>            Priority: Major
>              Labels: pull-request-available
>
> [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html]
> {quote} * 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 and retry the upload.
>  ** Expects the ETag value as a string.
>  ** For more information about conditional requests, see RFC 7232, or 
> Conditional requests in the Amazon S3 User Guide.
>  * If-None-Match
>  ** Uploads the object only if the object key name does not already exist in 
> the bucket specified. Otherwise, Amazon S3 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 retry the 
> upload.
>  ** Expects the '*' (asterisk) character.
>  ** For more information about conditional requests, see RFC 7232, or 
> Conditional requests in the Amazon S3 User Guide.{quote}
> After reviewing the aws s3 spec again, we didnt handle the 409 
> ConditionalRequestConflict case for both the if match and if-non-match path, 
> and I think we that case only happend in the key commit request, and we 
> should explictily handle it, try not to introduce new om exception if 
> possible, but the goal is to make the s3 gateway can tell different om 
> excption for conditional request to return correct s3 error(exception) to 
> application.
> if non match use atomic create-if-non-exist, and if match use atomic rewrite 
> with the expected generation id after the key create request verify the 
> expected etag. 
> we should add test cases for these, and I think this type exception can only 
> trigger by concurrent issued request
> Refer to commit:
>  # [https://github.com/apache/ozone/pull/10023]
>  # [https://github.com/apache/ozone/pull/9815]
>  # [https://github.com/apache/ozone/pull/9332] 
> for more detail



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to