ivandika3 commented on code in PR #10010:
URL: https://github.com/apache/ozone/pull/10010#discussion_r3141864986


##########
hadoop-hdds/docs/content/design/s3-conditional-requests.md:
##########
@@ -56,51 +66,214 @@ AWS S3 supports conditional requests using HTTP 
conditional headers, enabling at
 - **Atomic copy operations**: Copy only if source/destination meets specific 
conditions
 - **Prevent overwrite**: Copy only if destination doesn't exist
 
+### Conditional Deletes
+
+- **Delete-if-unchanged**: Delete only when the caller still sees the
+  expected object ETag
+- **Delete-if-exists**: Require the key to exist by sending
+  `If-Match: *`
+- **Race prevention**: Avoid deleting an object that was replaced by a
+  concurrent writer
+
 ## Specification
 
 ### AWS S3 Conditional Write Specification
 
-#### If-None-Match Header
+#### Supported Headers
 
-```
-If-None-Match: "*"
-```
+|   |   |   |
+|---|---|---|
+|**Header**|**Meaning**|**Failure result**|
+|`If-None-Match: "*"`|Write succeeds only if the object does not exist 
(put-if-absent semantics).|`412 Precondition Failed` if the object already 
exists.|
+|`If-Match: "<etag>"`|Write succeeds only if the object exists and its ETag 
matches (atomic update / compare-and-swap).|`412 Precondition Failed` if the 
object does not exist or the ETag does not match.|
 
-- Succeeds only if object does NOT exist
-- Returns `412 Precondition Failed` if object exists
-- Primary use case: Create-only semantics
+#### Restrictions
 
-#### If-Match Header
+- Cannot use both headers together in the same request.
+- No additional charges for failed conditional requests.
 
-```
-If-Match: "<etag>"
-```
+### AWS S3 Conditional CompleteMultipartUpload Specification
 
-- Succeeds only if object EXISTS and ETag matches
-- Returns `412 Precondition Failed` if object doesn't exist or ETag mismatches
-- Primary use case: Atomic updates (compare-and-swap)
+Conditional multipart completion applies to
+`CompleteMultipartUpload`. Although the request finalizes an existing
+multipart upload, the conditional headers are evaluated against the
+current committed object at the destination key, not against the MPU's
+temporary part state.
 
-#### Restrictions
+#### Supported Headers
+
+|   |   |   |
+|---|---|---|
+|**Header**|**Meaning**|**Failure result**|
+|`If-None-Match: "*"`|Complete the MPU only if no committed object currently 
exists at the destination key.|`412 Precondition Failed` if the destination key 
already exists.|
+|`If-Match: "<etag>"`|Complete the MPU only if the current committed object 
exists and its ETag matches.|`412 Precondition Failed` if the object is missing 
or the ETag does not match.|

Review Comment:
   I'm wondering how the client would derive the ETag for the final MPU 
complete request. Does the client need to know how MPU ETag is calculated in OM?



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