huaxingao commented on code in PR #3803:
URL: https://github.com/apache/polaris/pull/3803#discussion_r2820298268


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/IdempotencyStore.java:
##########
@@ -154,6 +154,24 @@ ReserveResult reserve(
   HeartbeatResult updateHeartbeat(
       String realmId, String idempotencyKey, String executorId, Instant now);
 
+  /**
+   * Cancels (deletes) an in-progress idempotency reservation owned by {@code 
executorId}.
+   *
+   * <p>This is used for cases where an idempotency key was reserved but the 
request should not be
+   * tracked for replay (for example, 401/403/408/429 responses per the 
proposal). Implementations
+   * should only cancel the record if it is still in-progress (i.e., not 
finalized) and owned by the
+   * given executor.
+   *
+   * @param realmId logical tenant or realm identifier
+   * @param idempotencyKey application-provided idempotency key
+   * @param executorId identifier of the executor that owns the reservation
+   * @return {@code true} if a record was cancelled, {@code false} otherwise
+   */
+  default boolean cancelInProgressReservation(
+      String realmId, String idempotencyKey, String executorId) {
+    return false;
+  }

Review Comment:
   I missed the 401/403/408/429 cases in the original IdempotencyStore SPI. 
Since we must not finalize/replay these responses for 401/403/408/429, we need 
an API to cancel the in‑progress reservation so keys don’t linger This is an 
additive default method on the SPI (backward compatible). I can split into a 
follow-up PR if you prefer.



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

Reply via email to