You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/08/13 10:58:41 UTC

[PR] [#12418] test: Add multi-node entity cache consistency tests [gravitino]

yuqi1129 opened a new pull request, #12460:
URL: https://github.com/apache/gravitino/pull/12460

   ### What changes were proposed in this pull request?
   
   Add real two-node entity cache consistency tests to the existing multi-instance workflow.
   
   The tests:
   
   - Enable entity caches on both Gravitino instances with a one-second change-log polling interval.
   - Cover METALAKE, CATALOG, SCHEMA, TABLE, TOPIC, VIEW, FILESET, TAG, POLICY, and JOB caches.
   - Exercise alter, rename, drop, cascade drop, disable/enable, same-name recreation, rapid updates, cross-type batches, reverse-direction propagation, and node restart.
   - Add Kafka and Iceberg JDBC backends for topic, table, view, and hierarchical schema coverage.
   - Keep the existing authorization consistency tests as a separate workflow step.
   
   ### Why are the changes needed?
   
   Cross-node cache invalidation was previously covered only by in-process unit tests. This adds end-to-end coverage using two real Gravitino server processes backed by the same relational store.
   
   Fix: #12418
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   - Ran the real two-process entity cache suite with MySQL and Kafka:
     - 52 dedicated consistency cases
     - 223 assertions
     - 0 failures
   - Validated the two node-restart consistency cases separately.
   - Ran `./gradlew spotlessApply`.
   - Validated shell syntax, workflow YAML parsing, and `git diff --check`.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12418] improvement(test): Add multi-node entity cache consistency tests [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #12460:
URL: https://github.com/apache/gravitino/pull/12460#issuecomment-5450848700

   @diqiu50 
   Could you help to review this PR if you have time? 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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12418] improvement(test): Add multi-node entity cache consistency tests [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 closed pull request #12460: [#12418] improvement(test): Add multi-node entity cache consistency tests
URL: https://github.com/apache/gravitino/pull/12460


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12418] improvement(test): Add multi-node entity cache consistency tests [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #12460:
URL: https://github.com/apache/gravitino/pull/12460#discussion_r3775544022


##########
dev/ci/setup_multi_instance.sh:
##########
@@ -41,6 +41,11 @@ curl -fsSL "${JDBC_URL}" -o "${JDBC_JAR}"
 EXPECTED_SHA1="$(curl -fsSL "${JDBC_URL}.sha1")"
 echo "${EXPECTED_SHA1}  ${JDBC_JAR}" | sha1sum --check
 
+# The entity-cache consistency test uses an Iceberg JDBC catalog. Catalogs have
+# isolated class loaders, so the driver must also be present in the catalog's
+# own libs directory before the distribution is copied for instance B.
+cp "${JDBC_JAR}" distribution/package/catalogs/lakehouse-iceberg/libs/

Review Comment:
   Fixed in 39b520f9ce. The setup now creates the Iceberg catalog libs directory before copying the JDBC driver.



##########
.github/workflows/multi-instance-consistency-test.yml:
##########
@@ -34,6 +33,15 @@ jobs:
           --health-interval=5s
           --health-timeout=3s
           --health-retries=20
+      kafka:
+        image: apache/kafka:3.9.1
+        ports:
+          - 9092:9092
+        options: >-
+          --health-cmd="/opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list"
+          --health-interval=5s
+          --health-timeout=10s
+          --health-retries=20

Review Comment:
   Fixed in 39b520f9ce. The workflow now configures Kafka explicitly in single-node KRaft mode, including controller quorum/listeners and a localhost advertised broker listener for the GitHub runner. I also verified this configuration with the apache/kafka:3.9.1 image and kafka-topics CLI.



-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12418] improvement(test): Add multi-node entity cache consistency tests [gravitino]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12460:
URL: https://github.com/apache/gravitino/pull/12460#issuecomment-5281872458

   <!-- coverage-report -->
   ### Code Coverage Report
   |Overall Project|68.66%|:green_circle:|
   |:-|:-|:-:|
   |Files changed|No Java source files changed|-|
   <br>
   
   |Module|Coverage||
   |:-|:-|:-:|
   |aliyun|1.72%|:red_circle:|
   |api|49.31%|:green_circle:|
   |authorization-common|85.96%|:green_circle:|
   |aws|42.04%|:green_circle:|
   |azure|2.47%|:red_circle:|
   |catalog-common|9.92%|:red_circle:|
   |catalog-fileset|79.77%|:green_circle:|
   |catalog-glue|68.95%|:green_circle:|
   |catalog-hive|79.4%|:green_circle:|
   |catalog-jdbc-common|45.7%|:green_circle:|
   |catalog-jdbc-doris|81.8%|:green_circle:|
   |catalog-jdbc-mysql|79.33%|:green_circle:|
   |catalog-jdbc-postgresql|83.39%|:green_circle:|
   |catalog-jdbc-starrocks|79.16%|:green_circle:|
   |catalog-kafka|77.01%|:green_circle:|
   |catalog-lakehouse-generic|59.18%|:green_circle:|
   |catalog-lakehouse-hudi|79.1%|:green_circle:|
   |catalog-lakehouse-iceberg|85.93%|:green_circle:|
   |catalog-lakehouse-paimon|84.23%|:green_circle:|
   |catalog-model|77.72%|:green_circle:|
   |cli|44.48%|:green_circle:|
   |client-java|78.46%|:green_circle:|
   |common|52.75%|:green_circle:|
   |core|83.63%|:green_circle:|
   |filesystem-hadoop3|77.28%|:green_circle:|
   |flink|0.0%|:red_circle:|
   |flink-common|48.68%|:green_circle:|
   |flink-runtime|0.0%|:red_circle:|
   |gcp|14.12%|:red_circle:|
   |hadoop-auth|68.0%|:green_circle:|
   |hadoop-common|12.7%|:red_circle:|
   |hive-metastore-common|53.4%|:green_circle:|
   |iceberg-aliyun-bundle|0.0%|:red_circle:|
   |iceberg-common|64.75%|:green_circle:|
   |iceberg-rest-server|75.1%|:green_circle:|
   |idp-basic|86.02%|:green_circle:|
   |integration-test-common|0.0%|:red_circle:|
   |jobs|62.92%|:green_circle:|
   |lance-common|31.75%|:red_circle:|
   |lance-rest-server|63.47%|:green_circle:|
   |lineage|53.02%|:green_circle:|
   |optimizer|83.24%|:green_circle:|
   |optimizer-api|21.95%|:red_circle:|
   |server|87.25%|:green_circle:|
   |server-common|79.41%|:green_circle:|
   |spark|28.57%|:red_circle:|
   |spark-common|45.89%|:green_circle:|
   |tencent|69.84%|:green_circle:|
   |trino-connector|40.29%|:green_circle:|
   


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12418] improvement(test): Add multi-node entity cache consistency tests [gravitino]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12460:
URL: https://github.com/apache/gravitino/pull/12460#discussion_r3774804989


##########
.github/workflows/multi-instance-consistency-test.yml:
##########
@@ -34,6 +33,15 @@ jobs:
           --health-interval=5s
           --health-timeout=3s
           --health-retries=20
+      kafka:
+        image: apache/kafka:3.9.1
+        ports:
+          - 9092:9092
+        options: >-
+          --health-cmd="/opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list"
+          --health-interval=5s
+          --health-timeout=10s
+          --health-retries=20

Review Comment:
   The `apache/kafka` image is started without the KRaft-related environment variables that this repo’s Testcontainers setup uses to boot Kafka. Without these env vars, the Kafka service may fail to start (or start with unexpected listeners), making the workflow flaky or broken.



##########
dev/ci/setup_multi_instance.sh:
##########
@@ -41,6 +41,11 @@ curl -fsSL "${JDBC_URL}" -o "${JDBC_JAR}"
 EXPECTED_SHA1="$(curl -fsSL "${JDBC_URL}.sha1")"
 echo "${EXPECTED_SHA1}  ${JDBC_JAR}" | sha1sum --check
 
+# The entity-cache consistency test uses an Iceberg JDBC catalog. Catalogs have
+# isolated class loaders, so the driver must also be present in the catalog's
+# own libs directory before the distribution is copied for instance B.
+cp "${JDBC_JAR}" distribution/package/catalogs/lakehouse-iceberg/libs/

Review Comment:
   `cp "${JDBC_JAR}" distribution/package/catalogs/lakehouse-iceberg/libs/` will abort the script (set -e) if the Iceberg catalog libs directory is missing in the assembled distribution. Create the destination directory explicitly to make the CI setup robust across packaging/layout changes.



-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12418] improvement(test): Add multi-node entity cache consistency tests [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 merged PR #12460:
URL: https://github.com/apache/gravitino/pull/12460


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org