huaxingao commented on code in PR #4659:
URL: https://github.com/apache/polaris/pull/4659#discussion_r3399211029
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -509,6 +662,75 @@ public LoadTableResponse createTableDirect(
throw new IllegalStateException("Cannot wrap catalog that does not produce
BaseTable");
}
+ /**
+ * Replay path for an idempotent {@code createTableDirect}: load the
existing table and rebuild a
+ * response with freshly-vended credentials for the current caller. No
credentials from the
+ * original call are stored or returned.
+ *
+ * <p>Authorization is not repeated here: {@link
#authorizeCreateTableDirect} already ran for the
+ * current caller in {@link #createTableDirect} before the idempotency
lookup, and the duplicate
+ * was matched on the same {@code principalHash} and request binding.
+ *
+ * <p>The replay reflects <em>current</em> catalog state rather than the
original response bytes
+ * (no response body is stored). To avoid silently returning a materially
different table, if the
+ * table has advanced beyond the metadata location captured when the key was
recorded, this raises
+ * 422 instead of returning divergent state.
+ */
+ private LoadTableResponse replayCreateTableDirect(
Review Comment:
Fixed. Thanks
--
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]