Skip to content

[Cherry-pick to branch-1.3] Resolve #13051 #13052 #13054 #13034 - #13060

Merged
jerryshao merged 4 commits into
apache:branch-1.3from
lasdf1234:cherry-pick-13034-13051-13052-13054-branch-1.3
Sep 10, 2026
Merged

[Cherry-pick to branch-1.3] Resolve #13051 #13052 #13054 #13034#13060
jerryshao merged 4 commits into
apache:branch-1.3from
lasdf1234:cherry-pick-13034-13051-13052-13054-branch-1.3

Conversation

@lasdf1234

@lasdf1234 lasdf1234 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

Manual conflict resolution of four cherry-picks onto branch-1.3 (supersedes conflicted bot PRs where applicable):

  1. [#9418] fix(iceberg): inject GCS FileIO token from gcs-service-account-file #12962 / [DO NOT MERGE] [Cherry-pick to branch-1.3] [#9418] fix(iceberg): inject GCS FileIO token from gcs-service-account-file (#12962) #13051 — Inject GCS FileIO OAuth2 token from gcs-service-account-file
  2. [#12998] fix(catalogs): Preserve upstream error messages when wrapping exceptions #12999 / [DO NOT MERGE] [Cherry-pick to branch-1.3] [#12998] fix(catalogs): Preserve upstream error messages when wrapping exceptions (#12999) #13052 — Preserve upstream error messages via ExceptionMessages
  3. [#12949] fix(iceberg-rest): Forward access-delegation header on federated loadTable #12950 / [DO NOT MERGE] [Cherry-pick to branch-1.3] [#12949] fix(iceberg-rest): Forward access-delegation header on federated loadTable (#12950) #13054 — Forward X-Iceberg-Access-Delegation on federated loadTable / create / register (adapted for 1.3 without main-only scan-plan federation APIs)
  4. [#13033] fix(iceberg): Map PostgreSQL JDBC auth failures to ConnectionFailedException #13034 — Map PostgreSQL JDBC auth SQLStates 28000 / 28P01 to ConnectionFailedException

Plus a minor test import fix for TableMetadataParser.

Why are the changes needed?

Auto cherry-pick PRs #13051, #13052, #13054 were blocked by cherry-pick-conflict. #13034 carries the branch-1.3 label and needs the same backport.

Does this PR introduce any user-facing change?

Same as the original PRs on main (credential vending / richer catalog errors / federated loadTable credentials / PG JDBC auth classification). No new APIs or property keys beyond those originals.

How was this patch tested?

./gradlew \
  :iceberg:iceberg-common:test --tests org.apache.gravitino.iceberg.common.utils.TestIcebergCatalogUtil \
  :common:test --tests org.apache.gravitino.utils.TestExceptionMessages \
  :catalogs:catalog-glue:test --tests org.apache.gravitino.catalog.glue.TestGlueExceptionConverter \
  :iceberg:iceberg-rest-server:test \
    --tests org.apache.gravitino.iceberg.service.TestCatalogWrapperForREST \
    --tests org.apache.gravitino.iceberg.service.TestIcebergRESTUtils \
    --tests org.apache.gravitino.iceberg.service.rest.TestIcebergTableOperations \
  -PskipITs

(Compile of TestCatalogWrapperForREST fixed by adding the missing TableMetadataParser import; please re-run the suite in CI.)

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

Code Coverage Report

Overall Project 69.36% +0.19% 🟢
Files changed 72.35% 🟢

Module Coverage
aliyun 19.74% 🔴
api 47.62% 🟢
authorization-common 85.96% 🟢
aws 53.54% 🟢
azure 32.1% 🔴
catalog-common 19.13% -0.03% 🔴
catalog-fileset 80.35% +12.38% 🟢
catalog-glue 70.98% +2.37% 🟢
catalog-hive 79.42% -3.64% 🟢
catalog-jdbc-clickhouse 84.7% 🟢
catalog-jdbc-common 44.83% 🟢
catalog-jdbc-doris 82.61% +2.38% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 81.8% 🟢
catalog-jdbc-oceanbase 78.6% 🟢
catalog-jdbc-postgresql 83.89% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 75.49% +17.42% 🟢
catalog-lakehouse-generic 59.97% -30.03% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.98% 🟢
catalog-lakehouse-paimon 82.17% -2.03% 🟢
catalog-model 77.99% +44.06% 🟢
cli 44.51% 🟢
client-java 78.31% 🟢
common 51.07% +0.27% 🟢
core 83.29% 🟢
filesystem-hadoop3 77.3% 🟢
flink 0.0% 🔴
flink-common 50.47% 🟢
flink-runtime 0.0% 🔴
gcp 32.2% 🔴
hadoop-common 15.43% +3.09% 🔴
hive-metastore-common 53.92% -9.25% 🟢
iceberg-aliyun-bundle 0.0% 🔴
iceberg-common 59.96% +0.19% 🟢
iceberg-rest-server 74.93% +2.43% 🟢
idp-basic 86.76% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 26.34% 🔴
lance-rest-server 60.77% 🟢
lineage 59.39% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 89.15% -0.32% 🟢
server-common 77.2% 🟢
spark 28.57% 🔴
spark-common 45.83% 🟢
trino-connector 58.39% 🟢
Files
Module File Coverage
catalog-common IcebergConstants.java 0.0% 🔴
catalog-fileset FilesetCatalogOperations.java 82.12% 🟢
catalog-glue GlueExceptionConverter.java 96.88% 🟢
GlueTableOperations.java 90.52% 🟢
catalog-hive HiveCatalogOperations.java 81.68% 🟢
HiveTableOperations.java 77.33% 🟢
HiveViewCatalogOperations.java 73.73% 🟢
catalog-jdbc-doris DorisTableOperations.java 84.91% 🟢
catalog-kafka KafkaCatalogOperations.java 79.12% 🟢
catalog-lakehouse-generic LanceTableOperations.java 61.05% 🟢
GenericCatalogOperations.java 29.17% 🔴
catalog-lakehouse-paimon CatalogUtils.java 49.23% 🔴
catalog-model ModelCatalogOperations.java 85.9% 🟢
common ExceptionMessages.java 92.31% 🟢
core GroupRoleRelPostgreSQLProvider.java 100.0% 🟢
hadoop-common FileSystemUtils.java 33.33% 🔴
HDFSFileSystemProxy.java 0.0% 🔴
hive-metastore-common HiveClientFactory.java 85.22% 🟢
KerberosClient.java 84.42% 🟢
HiveExceptionConverter.java 80.95% 🟢
ProxyHiveClientImpl.java 80.95% 🟢
Util.java 71.79% 🟢
HiveClient.java 0.0% 🔴
HiveClientImpl.java 0.0% 🔴
HiveShim.java 0.0% 🔴
HiveShimV2.java 0.0% 🔴
HiveShimV3.java 0.0% 🔴
iceberg-common IcebergCatalogUtil.java 61.27% 🟢
iceberg-rest-server FederatedCatalogWrapper.java 95.51% 🟢
IcebergCatalogWrapperManager.java 91.95% 🟢
IcebergRESTUtils.java 89.04% 🟢
IcebergTableOperations.java 81.28% 🟢
server GravitinoInterceptionService.java 92.72% 🟢
ParameterUtil.java 62.07% 🟢

@lasdf1234
lasdf1234 force-pushed the cherry-pick-13034-13051-13052-13054-branch-1.3 branch 3 times, most recently from b49128a to 0a057df Compare September 10, 2026 09:15
lasdf1234 and others added 4 commits September 10, 2026 19:07
…account-file (apache#12962)

Iceberg's `GCSFileIO` does not understand Gravitino's
`gcs-service-account-file`.
When that property is set, load the service account at catalog
initialization and
inject Iceberg `gcs.oauth2.token` / `gcs.oauth2.token-expires-at` so
server-side
FileIO can authenticate (same property-injection style as S3/OSS/ADLS
key mapping).
Also update GCS docs that previously required
`GOOGLE_APPLICATION_CREDENTIALS`
even when the catalog property was set.

`gcs-service-account-file` reached the credential provider (vending
worked) but not
FileIO. Table create wrote metadata with Application Default Credentials
and failed
with 401 unless `GOOGLE_APPLICATION_CREDENTIALS` was set on the process.

Fix: apache#9418

- Configuring `gcs-service-account-file` is sufficient for Iceberg GCS
FileIO;
`GOOGLE_APPLICATION_CREDENTIALS` is only a fallback when the property is
unset.
- No new public API or property keys.

```
./gradlew :iceberg:iceberg-common:test --tests org.apache.gravitino.iceberg.common.utils.TestIcebergCatalogUtil -PskipITs
```

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…rapping exceptions (apache#12999)

- Add `ExceptionMessages` helper to append the underlying cause message
when wrapping exceptions.
- Update catalog catch-all wraps (Kafka, Glue, Hive/HMS, Fileset, Model,
Lance, Doris, Paimon, Hadoop FS) to use it.
- Kafka: map invalid configuration on create/alter to
`IllegalArgumentException` (4xx).
- Glue: keep upstream text in default errors; map
`AccessDeniedException` to `ForbiddenException`.
- Add unit tests for `ExceptionMessages` and `GlueExceptionConverter`.

Connectors were replacing actionable upstream errors with generic
messages. Operators only saw the stack trace. Client-caused failures
were also returned as 500.

Fix: apache#12998

Yes. Failed catalog operations may return richer `message` text
(upstream reason included). Some Kafka invalid-config and Glue
access-denied failures map to 400/403 instead of 500.

- Unit tests: `TestExceptionMessages`, `TestGlueExceptionConverter`
- Suggested local run:
`./gradlew spotlessApply :common:test --tests
org.apache.gravitino.utils.TestExceptionMessages
:catalogs:catalog-glue:test --tests
org.apache.gravitino.catalog.glue.TestGlueExceptionConverter -PskipITs`

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
… federated loadTable (apache#12950)

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.

Fix: apache#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.

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.

- `./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](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
…nectionFailedException (apache#13034)

Classify Iceberg JDBC catalog authorization failures via SQLState class
`28` (plus MySQL/PostgreSQL message fallbacks), so PostgreSQL
bad-credential errors become `ConnectionFailedException` like MySQL
`Access denied`.

Previously only the literal `Access denied` was matched. PostgreSQL
reports `password authentication failed` / `role ... does not exist`
(`28P01` / `28000`), so failures escaped as raw `UncheckedSQLException`.

Fix: apache#13033

- PostgreSQL Iceberg JDBC catalogs with bad credentials now surface
`ConnectionFailedException` instead of a generic internal error.
- No new APIs or property keys.

```
./gradlew :iceberg:iceberg-common:test --tests org.apache.gravitino.iceberg.common.utils.TestIcebergCatalogUtil -PskipITs
```

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@lasdf1234
lasdf1234 force-pushed the cherry-pick-13034-13051-13052-13054-branch-1.3 branch from 0a057df to 6658748 Compare September 10, 2026 11:08
@jerryshao
jerryshao merged commit 8d1e152 into apache:branch-1.3 Sep 10, 2026
35 checks passed
@lasdf1234
lasdf1234 deleted the cherry-pick-13034-13051-13052-13054-branch-1.3 branch September 11, 2026 00:10
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.

2 participants