huaxingao commented on code in PR #14196:
URL: https://github.com/apache/iceberg/pull/14196#discussion_r2415480930


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -1903,6 +2003,39 @@ components:
       schema:
         type: string
 
+    idempotency-key:
+      name: Idempotency-Key
+      in: header
+      required: false
+      schema:
+        type: string
+        format: uuid
+        minLength: 36
+        maxLength: 36
+        example: "550e8400-e29b-41d4-a716-446655440000"
+      description: |
+        Optional client-provided idempotency key for safe request retries.
+
+        When present, the server ensures no additional effects for requests 
that carry the same
+        Idempotency-Key within the same operation/resource scope. If a prior 
request with this key
+        has been finalized, the server returns an equivalent final response 
without re-running the
+        operation. The response body may reflect a newer state of the table 
than existed at the
+        time of the commit.
+
+        Finalization rules:
+        - Finalize & replay: 200, 201, 204, and deterministic terminal 4xx
+        - Do not finalize (not stored/replayed): 5xx, 409 
(RequestInProgressException)
+
+        Key Requirements:
+        - Key format: UUID (V7 preferred) in string format as defined in RFC 
9562 Section 4.
+          See https://datatracker.ietf.org/doc/html/rfc9562#sampleStringUUID 
for the textual
+          representation specification.
+        - Scoped to operation type and resource path; the idempotency key must 
be unique per
+          (operation type, resource path) pair (e.g., updateTable on db.t1)

Review Comment:
   We agreed not to compare payloads. Idempotency is determined by (operation 
type, resource path, idempotency key) only.
   
   Within the same (op, path):
   
   - Retry the same attempt: reuse the same key.
   - Start a new attempt (e.g., append a different snapshot or change different 
properties): generate a new key.
   
   Across different ops or paths: the scope changes, so reusing the same key is 
treated as a different request.
   
   If this feels confusing, we can simplify further: always generate a new 
idempotency key for every new attempt and reuse it only for retries of that 
attempt.



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