Skip to content

[#12949] fix(iceberg-rest): Forward access-delegation header on federated loadTable - #12950

Open
lasdf1234 wants to merge 7 commits into
apache:mainfrom
lasdf1234:fix/federated-load-table-access-delegation
Open

[#12949] fix(iceberg-rest): Forward access-delegation header on federated loadTable#12950
lasdf1234 wants to merge 7 commits into
apache:mainfrom
lasdf1234:fix/federated-load-table-access-delegation

Conversation

@lasdf1234

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

Forward X-Iceberg-Access-Delegation: vended-credentials when a federated Iceberg REST catalog (catalog-backend: rest) loads a table, and rewrite remote credential refresh endpoints to this IRC catalog.

FederatedCatalogWrapper.loadTable previously ignored requestCredential and used Iceberg's RESTCatalog.loadTable, which does not send the access-delegation header. Scan-plan federation already forwarded the header; load table now uses the same authenticated REST GET path.

Why are the changes needed?

Fix: #12949

A REST-backend Iceberg catalog dropped the client's credential-vending request. The near-end IRC logged credential vending: true, but the forwarded load arrived at the remote catalog with access delegation: null. Direct loads against the remote returned storage-credentials; federated loads returned only metadata, so engines failed on the first data read.

Does this PR introduce any user-facing change?

Yes. Clients that send X-Iceberg-Access-Delegation: vended-credentials through a federated Iceberg REST catalog now receive remote storage-credentials on loadTable, matching a direct load against the remote catalog.

No new APIs or property keys.

How was this patch tested?

  • ./gradlew :iceberg:iceberg-rest-server:test --tests org.apache.gravitino.iceberg.service.TestCatalogWrapperForREST --tests org.apache.gravitino.iceberg.service.TestIcebergRESTUtils -PskipITs
  • New unit tests cover header forwarding on vended federated load, omitting the header when vending is not requested, and rewriting upstream refresh endpoints.

Made with Cursor

… federated loadTable

REST-backend Iceberg catalogs ignored credential vending on load, so remote catalogs never returned storage-credentials.

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

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Code Coverage Report

Overall Project 69.64% -0.01% 🟢
Files changed 68.84% 🟢

Module Coverage
aliyun 19.74% 🔴
api 51.57% 🟢
authorization-common 85.96% 🟢
authorization-ranger 4.38% 🔴
aws 53.54% 🟢
azure 32.1% 🔴
catalog-common 20.87% 🔴
catalog-fileset 82.17% 🟢
catalog-glue 69.24% -0.55% 🟢
catalog-hive 82.96% 🟢
catalog-jdbc-common 45.09% 🟢
catalog-jdbc-doris 82.69% 🟢
catalog-jdbc-mysql 79.33% 🟢
catalog-jdbc-postgresql 83.83% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 76.99% 🟢
catalog-lakehouse-generic 60.88% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.9% 🟢
catalog-lakehouse-paimon 84.29% 🟢
catalog-model 77.99% 🟢
cli 44.51% 🟢
client-java 77.5% 🟢
common 56.89% 🟢
core 84.18% 🟢
filesystem-hadoop3 76.48% 🟢
flink 0.0% 🔴
flink-common 52.1% -3.15% 🟢
flink-runtime 0.0% 🔴
gcp 32.2% 🔴
hadoop-auth 68.0% 🟢
hadoop-common 17.84% 🔴
hive-metastore-common 53.5% 🟢
iceberg-aliyun-bundle 0.0% 🔴
iceberg-common 66.58% 🟢
iceberg-rest-server 76.84% +2.0% 🟢
idp-basic 87.1% 🟢
integration-test-common 0.0% 🔴
jobs 62.92% 🟢
lance-common 32.52% 🔴
lance-rest-server 68.12% 🟢
lineage 59.39% 🟢
optimizer 83.17% 🟢
optimizer-api 21.95% 🔴
server 90.11% 🟢
server-common 81.23% 🟢
spark 28.57% 🔴
spark-common 52.04% +1.16% 🟢
tencent 81.78% 🟢
trino-connector 58.36% 🟢
Files
Module File Coverage
catalog-glue GravitinoGlueCredentialsProvider.java 0.0% 🔴
flink-common PostgresqlPropertiesConverter.java 100.0% 🟢
JdbcPropertiesConverter.java 58.82% 🔴
BaseCatalog.java 43.62% 🔴
iceberg-rest-server FederatedCatalogWrapper.java 96.43% 🟢
IcebergRESTUtils.java 90.12% 🟢
IcebergTableOperations.java 81.45% 🟢
spark-common GluePropertiesConverter.java 100.0% 🟢
GravitinoGlueCredentialsProvider.java 100.0% 🟢

lasdf1234 and others added 3 commits September 7, 2026 16:19
…ames

Co-authored-by: Cursor <cursoragent@cursor.com>
…d keep refs credentials

Always load federated tables via REST GET, forward access-delegation on create/register when vending, and preserve storage-credentials when filtering snapshots=refs.

Co-authored-by: Cursor <cursoragent@cursor.com>
…y methods

Co-authored-by: Cursor <cursoragent@cursor.com>
@lasdf1234 lasdf1234 self-assigned this Sep 7, 2026
lasdf1234 and others added 2 commits September 7, 2026 17:55
…r via REST

Route createTable and registerTable through the same REST path as loadTable so requestCredential only toggles the access-delegation header.

Co-authored-by: Cursor <cursoragent@cursor.com>
@roryqi
roryqi self-requested a review September 7, 2026 11:31
…m loadTable config

Co-authored-by: Cursor <cursoragent@cursor.com>
@roryqi

roryqi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Did we test them by hand? We need some integration test cases.

@lasdf1234

lasdf1234 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Did we test them by hand? We need some integration test cases.

I'll test it use my real environment.If we use IT to test,it'll cost so mutch time.

@jerryshao jerryshao added the branch-1.3 Automatically cherry-pick commit to branch-1.3 label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-1.3 Automatically cherry-pick commit to branch-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug report] Federated Iceberg REST catalogs drop X-Iceberg-Access-Delegation on loadTable

3 participants