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

Chu Cheng Li updated HDDS-13919:
--------------------------------
    Description: 
h4. Headers

h5. If-Match: <etag> - Succeeds only if the object EXISTS and its ETag matches
 - Returns `412 Precondition Failed` if object doesn't exist or ETag doesn't 
match
 - Primary use case: Atomic updates (similar to compare-and-swap)
 - Enables optimistic locking patterns

h5. If-None-Match: "*" - Succeeds only if the object does NOT exist
 - Returns `412 Precondition Failed` if object already exists
 - Primary use case: Prevent accidental overwrites (create-only semantics)

h4. Behavior Notes
 - Both headers can be used independently for different use cases
 - If-Match enables atomic rewrites (update existing object only if unchanged)
 - If-None-Match enables atomic creates (create only if doesn't exist)
 - Cannot use both If-Match and If-None-Match together in the same request

h4. Error Codes

h5. 412 Precondition Failed - When condition is not met
 - No additional charges for failed conditional requests

  was:
h4. Headers
- **If-Match: <etag>** - Succeeds only if the object EXISTS and its ETag matches
  - Returns `412 Precondition Failed` if object doesn't exist or ETag doesn't 
match
  - Primary use case: Atomic updates (similar to compare-and-swap)
  - Enables optimistic locking patterns

- **If-None-Match: "*"** - Succeeds only if the object does NOT exist
  - Returns `412 Precondition Failed` if object already exists
  - Primary use case: Prevent accidental overwrites (create-only semantics)

h4. Behavior Notes
- Both headers can be used independently for different use cases
- If-Match enables atomic rewrites (update existing object only if unchanged)
- If-None-Match enables atomic creates (create only if doesn't exist)
- Cannot use both If-Match and If-None-Match together in the same request

h4. Error Codes
- **412 Precondition Failed** - When condition is not met
- No additional charges for failed conditional requests


> Conditional Writes (PutObject)
> ------------------------------
>
>                 Key: HDDS-13919
>                 URL: https://issues.apache.org/jira/browse/HDDS-13919
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: Ozone Manager, s3gateway
>            Reporter: Chu Cheng Li
>            Assignee: Chu Cheng Li
>            Priority: Major
>
> h4. Headers
> h5. If-Match: <etag> - Succeeds only if the object EXISTS and its ETag matches
>  - Returns `412 Precondition Failed` if object doesn't exist or ETag doesn't 
> match
>  - Primary use case: Atomic updates (similar to compare-and-swap)
>  - Enables optimistic locking patterns
> h5. If-None-Match: "*" - Succeeds only if the object does NOT exist
>  - Returns `412 Precondition Failed` if object already exists
>  - Primary use case: Prevent accidental overwrites (create-only semantics)
> h4. Behavior Notes
>  - Both headers can be used independently for different use cases
>  - If-Match enables atomic rewrites (update existing object only if unchanged)
>  - If-None-Match enables atomic creates (create only if doesn't exist)
>  - Cannot use both If-Match and If-None-Match together in the same request
> h4. Error Codes
> h5. 412 Precondition Failed - When condition is not met
>  - No additional charges for failed conditional requests



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