Skip to content

[#11128] fix(iceberg): Merge server IRC config for dynamic provider#11153

Open
lasdf1234 wants to merge 24 commits into
apache:mainfrom
lasdf1234:irc-cache-property-improve
Open

[#11128] fix(iceberg): Merge server IRC config for dynamic provider#11153
lasdf1234 wants to merge 24 commits into
apache:mainfrom
lasdf1234:irc-cache-property-improve

Conversation

@lasdf1234
Copy link
Copy Markdown
Collaborator

@lasdf1234 lasdf1234 commented May 19, 2026

What changes were proposed in this pull request?

This PR aligns dynamic IRC catalog configuration with the static provider layering model.

Changes include:

  • Extract StaticIcebergConfigProvider.initCatalogConfigs() so server-side catalog config parsing is shared.
  • In DynamicIcebergConfigProvider, load server configs at initialization and merge them into each dynamic catalog config via putIfAbsent in mergeServerConfig().
  • Catalog-level properties from Gravitino still take precedence; server defaults only fill missing keys.
  • Named catalogs merge catalog.<name>.* server keys; the default catalog also merges root gravitino.iceberg-rest.* settings.

Why are the changes needed?

Authorization-enabled deployments use the dynamic config provider. Operators can set server-level IRC properties such as gravitino.iceberg-rest.table-metadata-cache-* (visible in boot logs), but those settings were not applied to dynamic catalogs. The static provider path already worked; this change makes the dynamic path behave the same way.

Fix: #11128

Does this PR introduce any user-facing change?

Yes.

  • Server-level gravitino.iceberg-rest.* and catalog.<name>.* IRC properties now apply to dynamic catalogs when keys are missing from the Gravitino catalog definition.
  • Per-catalog properties still override server defaults when both are set.
  • No new API or configuration keys are introduced.

How was this patch tested?

Commands:

./gradlew :iceberg:iceberg-rest-server:test -PskipITs -PskipDockerTests=true -PskipWeb=true \
  --tests "org.apache.gravitino.iceberg.service.provider.TestDynamicIcebergConfigProvider.testNamedDynamicCatalogMergesNamedStaticConfigOnly" \
  --tests "org.apache.gravitino.iceberg.service.provider.TestDynamicIcebergConfigProvider.testDefaultCatalogMergesRootServerConfig"
./gradlew :iceberg:iceberg-rest-server:test -PskipTests -PskipDockerTests=false -PskipWeb=true \
  --tests "org.apache.gravitino.iceberg.integration.test.IcebergDynamicServerConfigMergeIT"

lasdf1234 and others added 2 commits May 19, 2026 19:54
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lasdf1234 lasdf1234 changed the title [#11128] fix(iceberg): merge server-level IRC cache config for dynamic provider [#11128] fix(iceberg): Merge server-level IRC cache config for dynamic provider May 19, 2026
lasdf1234 and others added 2 commits May 19, 2026 21:04
…ogConfigLoader

Extract shared loading logic under a clearer name and preserve the default
catalog merge key when resolving dynamic catalog configs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lasdf1234 lasdf1234 changed the title [#11128] fix(iceberg): Merge server-level IRC cache config for dynamic provider [#11128] fix(iceberg): Merge server IRC config for dynamic provider May 19, 2026
lasdf1234 and others added 12 commits May 20, 2026 00:08
Restore original getCatalogName parsing in StaticIcebergConfigProvider while
retaining initCatalogConfigs for dynamic provider reuse, and fix default catalog
server config merge via serverCatalogKey.

Co-authored-by: Cursor <cursoragent@cursor.com>
Increase the default table-metadata-cache-capacity from 200 to 1000
for IRC and lakehouse-iceberg catalogs to better match production workloads.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lasdf1234 lasdf1234 marked this pull request as ready for review May 19, 2026 17:14
Copilot AI review requested due to automatic review settings May 19, 2026 17:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR enhances Iceberg REST server configuration behavior by introducing server-side static config parsing that can be merged into dynamically fetched Gravitino catalog configs, while also increasing the default table-metadata cache capacity and updating related docs/metadata.

Changes:

  • Refactor static catalog config parsing into a reusable initCatalogConfigs method and add tests around static/dynamic config behavior.
  • Add server-side config merging to DynamicIcebergConfigProvider to fill missing catalog config keys from server defaults.
  • Increase default table-metadata-cache-capacity from 200 to 1000 and update docs + catalog property metadata accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/provider/TestDynamicIcebergConfigProvider.java Adds test coverage for server config loading and merge behavior for default vs named catalogs
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/provider/StaticIcebergConfigProvider.java Refactors static catalog config parsing into initCatalogConfigs for reuse/testing
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/provider/DynamicIcebergConfigProvider.java Merges server-side configs into dynamic catalog configs returned from Gravitino
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/IcebergConfig.java Raises default table metadata cache capacity
docs/lakehouse-iceberg-catalog.md Updates documented default cache capacity
docs/iceberg-rest-service.md Updates documented default cache capacity for REST service
catalogs/catalog-lakehouse-iceberg/src/main/java/org/apache/gravitino/catalog/lakehouse/iceberg/IcebergCatalogPropertiesMetadata.java Updates catalog property metadata default value

@lasdf1234 lasdf1234 changed the title [#11128] fix(iceberg): Merge server IRC config for dynamic provider [#11128] fix(iceberg): Merge server IRC config for dynamic provider and raise cache default May 19, 2026
@lasdf1234 lasdf1234 changed the title [#11128] fix(iceberg): Merge server IRC config for dynamic provider and raise cache default [#11128] fix(iceberg): Merge server IRC config for dynamic provider May 19, 2026
lasdf1234 and others added 5 commits May 20, 2026 01:23
…t catalog

When the resolved catalog name matches default-catalog-name, use the
default_catalog server-side IcebergConfig entry in mergeServerConfig.
Add integration test for dynamic provider server config merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
Focus integration coverage on root-level table-metadata-cache merge and
loadTable cache initialization. Extend unit tests for default and resolved
catalog names and drop redundant static initCatalogConfigs coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use Map.of for mock catalog properties in testNamedDynamicCatalogMergesNamedStaticConfigOnly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lasdf1234
Copy link
Copy Markdown
Collaborator Author

@roryqi If you have time, please review it for me. Thank you.

@roryqi
Copy link
Copy Markdown
Contributor

roryqi commented May 20, 2026

Dynamic provider shouldn't contain server irc config. It's not a good design.

lasdf1234 and others added 3 commits May 21, 2026 07:29
Root gravitino.iceberg-rest.* settings are stored under default_catalog in
initCatalogConfigs; apply them only for the configured default dynamic
catalog. Use a dedicated schema name in the merge IT to avoid colliding
with authorization tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align unit and integration tests with DynamicIcebergConfigProvider
behavior: only catalog.<name>.* server keys merge into dynamic catalogs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown

Code Coverage Report

Overall Project 66.09% -0.02% 🟢
Files changed 54.29% 🔴

Module Coverage
aliyun 1.72% 🔴
api 46.83% 🟢
authorization-common 85.96% 🟢
aws 1.08% 🔴
azure 2.47% 🔴
catalog-common 10.2% 🔴
catalog-fileset 80.02% 🟢
catalog-glue 64.03% 🟢
catalog-hive 79.59% 🟢
catalog-jdbc-clickhouse 80.02% 🟢
catalog-jdbc-common 44.46% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 82.17% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 44.89% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.8% 🟢
catalog-lakehouse-paimon 77.25% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.92% 🟢
common 49.99% 🟢
core 82.2% 🟢
filesystem-hadoop3 76.97% 🟢
flink 0.0% 🔴
flink-common 43.17% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 53.26% 🟢
iceberg-common 55.24% 🟢
iceberg-rest-server 69.83% -0.69% 🟢
idp-basic 94.17% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 20.9% 🔴
lance-rest-server 62.78% 🟢
lineage 53.02% 🟢
optimizer 82.87% 🟢
optimizer-api 21.95% 🔴
server 85.75% 🟢
server-common 71.21% 🟢
spark 32.79% 🔴
spark-common 39.09% 🔴
trino-connector 34.82% 🔴
Files
Module File Coverage
iceberg-rest-server StaticIcebergConfigProvider.java 88.46% 🟢
DynamicIcebergConfigProvider.java 46.49% 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug report] Server-level table cache config issue

3 participants