laserninja commented on code in PR #14972:
URL: https://github.com/apache/gravitino/pull/14972#discussion_r4594424213


##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/idempotency/IdempotencyStoreFactory.java:
##########
@@ -33,7 +33,11 @@ public class IdempotencyStoreFactory {
    * fully-qualified class name for them.
    */
   private static final ImmutableMap<String, String> STORE_CLASS_NAMES =
-      ImmutableMap.of("in-memory", 
InMemoryIdempotencyStore.class.getCanonicalName());
+      ImmutableMap.of(
+          "in-memory",
+          InMemoryIdempotencyStore.class.getCanonicalName(),
+          "jdbc",
+          
"org.apache.gravitino.iceberg.service.idempotency.JdbcIdempotencyStore");

Review Comment:
   Made the packaging requirement explicit in the service guide and JDBC design 
section in 8aa3d9080: the implementation lives in the Iceberg REST server JAR 
and must be visible to the auxiliary service class loader. iceberg-common alone 
is insufficient, and a missing implementation surfaces as a 
ClassNotFoundException cause during store creation. The alias and module 
boundary are unchanged.



##########
scripts/mysql/schema-2.0.0-mysql.sql:
##########
@@ -816,3 +816,16 @@ CREATE TABLE IF NOT EXISTS `domain_rel` (
     KEY `domain_rel_idx_parent` (`parent_id`, `deleted_at`),
     KEY `domain_rel_idx_metalake` (`metalake_id`, `deleted_at`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT 'domain 
parent relation';
+
+CREATE TABLE IF NOT EXISTS `iceberg_idempotency_key_meta` (
+  `idempotency_key`   VARCHAR(36)         NOT NULL COMMENT 'client-provided 
UUIDv7 idempotency key',
+  `operation_binding` TEXT        NOT NULL COMMENT 'request identity, e.g. 
POST /v1/{prefix}/namespaces/{ns}/tables',
+  `claim`             BIGINT NOT NULL COMMENT 'reservation fencing token',
+  `http_status`       INT(10)    UNSIGNED DEFAULT NULL COMMENT 'HTTP status of 
finalized response, NULL while reserved',
+  `response_summary`  MEDIUMTEXT          DEFAULT NULL COMMENT 'serialized 
response body (JSON) for replay',
+  `audit_info`        MEDIUMTEXT          NOT NULL COMMENT 'idempotency record 
audit info',
+  `created_at`        BIGINT(20) UNSIGNED NOT NULL COMMENT 'record created at 
(unix epoch millis)',
+  `expires_at`        BIGINT(20) UNSIGNED NOT NULL COMMENT 'record expires at 
(unix epoch millis)',
+  PRIMARY KEY (`idempotency_key`),
+  KEY `idx_iik_expires` (`expires_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT 'Iceberg 
REST idempotency key records';

Review Comment:
   Added assertions to TestSQLScripts for the idempotency table columns, 
including claim, and idx_iik_expires on expires_at, for both fresh 2.0.0 
schemas and upgrades in 8aa3d9080. Both script checks pass on H2, MySQL, and 
PostgreSQL. Also synchronized the JDBC design text with the implementation: 
signed claim, TEXT binding, actual schema paths, plain INSERT/duplicate 
handling, inclusive expiry, shared connection pool, and no clock-skew grace 
period.



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