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


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -1903,6 +1926,34 @@ 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 the previously finalized 
response instead of
+        re-executing the mutation.
+
+        Finalization rules:
+        - Finalize & replay: 200, 201, 204, and deterministic terminal 4xx
+        - Do not finalize (not stored/replayed): 5xx, 409 request_in_progress
+
+        Key Requirements:
+        - Key format: UUID (V7 preferred)

Review Comment:
   if a client is misbehaving but assume things are fine because one server is 
not complaining, but things start to go wrong when the client is addressing a 
different server (like rejecting a non v7 uuid or an old one), then it's a 
major client issue.
   
   IMHO server is not required to do anything (it's not even required to 
support idempotency key) but if it chooses to, it should be able to leverage as 
much information the key can give. For the client it should not change 
anything: client should generate a conformant uuid for each request, client 
should not retry a request beyond the advertised life time, client should 
interpret the error messages according to the spec.
   
   If for example uuid v7 is not mandatory but just preferred, then there's no 
point for a server to analyze the uuid and decide to reject very old requests 
because a client may send any uuid (technically it could still do it but if 
clients are not forced, most likely they would use v4 and server would not get 
any benefit from it)



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