Gabriel39 opened a new pull request, #71031: URL: https://github.com/apache/doris/pull/71031
### Background Iceberg catalogs use FileIO to read table metadata and manifests. Doris configures Hadoop credentials for GCS, while the native Google SDK consumes separate `gcs.*` options and REST-vended storage credentials. Metadata system-table scans serialize Iceberg tasks from FE to the BE Java plugin, creating independent FileIO owners. ### What problem does this PR solve? Issue Number: None Related PR: #62988 (introduced Google REST authentication and compatibility routing), #70965 (release-branch adaptation), #70980 (same fixes on branch-4.2) PR Type: Bugfix Problem Summary: GCS reads can ignore Hadoop credentials when a catalog explicitly chooses the generic resolver or loads its configuration only from XML; the compatibility resolver can instead discard native SDK encryption, billing and storage-token options. Completed metadata scans also leave their deserialized FileIO clients and refresh callbacks alive, and native SDK encryption keys lack explicit masking declarations. Preserve the effective storage configuration and SDK credential precedence, close each scan's independent owner, and mask the keys. Most added lines are regression fixtures covering real SDK/Hadoop reads and resource ownership. ### Details - **Change map:** Approximately 260 changed production/build lines handle routing, scanner ownership and masking; 833 added test lines cover HTTP/storage/XML fixtures and failure paths. The shared package bridge enables SDK package-private task access on both plugin loaders; the HDFS dependency is test-only. - **Frequency:** Always under the reproduced configuration or task-lifecycle triggers; no external service is needed to reproduce them. - **Root cause:** Generic SDK routing bypasses Hadoop credentials, while `NativeGcsResolvingFileIO` ignores final SDK properties and credentials. The factory checks raw properties before effective XML configuration is available; the scanner closes only its iterator, and provider masking omits native encryption keys. - **Why existing tests missed it:** `IcebergCatalogFactoryTest` covers default/raw routing and explicit concrete FileIO choices; scanner tests cover successful rows and serialization, without owner-close assertions. SQL system-table suites use REST/MinIO/S3 and check rows, projections and privileges; they do not exercise Google SDK options, XML identities, refresh cancellation or CSEK audit masking. - **Fix:** Select the compatibility resolver after effective Hadoop configuration exists; at runtime retain native SDK options and only the longest matching storage credential (last occurrence for duplicates), matching Iceberg precedence. Close the deserialized owner after its iterator on completion/failure, preserving the primary exception and FE-owned original. Register encryption/decryption keys with the existing masking surface. - **Other paths and branches:** REST/HMS/JDBC/Hadoop/Glue generic choices are covered; explicit concrete/custom FileIO, vending, non-REST defaults and non-GCS schemes are preserved. Master uses Iceberg 1.12.0; branch-4.2 has the earlier 1.11.0 adaptation in #70980, and branch-4.1's #70965 remains open; SDK 1.11.0 also needs the prefix-selection correction in follow-up backports. Branches 3.1/4.0 retain reader-only cleanup with Iceberg 1.9.1 and need separate adaptation. The routing behavior originated in #62988; the original scanner-ownership introduction was not established. ### Testing - Unfixed master: 32 focused tests ran; 28 failed by assertion, with no errors/skips. Valid overlapping-prefix regression separately fails on the initial candidate before its correction. - Local preset `run-fe-ut.sh --run` passed 182 tests before the final duplicate-prefix correction. All 133 affected connector cases passed again after the correction; the 49 unchanged FE/scanner cases remain covered by the preset run. - Fresh FE and BE packaged-loader probes passed using the actual plugin runtimes: SDK tasks and the bridge share defining loaders, candidate class bytes match, and default/global/overlapping/duplicate routing behaves correctly. ### Notes for Reviewers Deploy both the FE connector and BE Iceberg Java plugin packages. The resolver's serialized identity and projection behavior are unchanged. No live GCS/Polaris cluster, token-renewal execution, rolling-upgrade cluster or deployed SQL suite was run; loopback fixtures exercise actual SDK/Hadoop reads and pending refresh cancellation. ### Release note Fix Iceberg GCS credential and SDK-option routing, mask native encryption keys in SHOW/audit output, and release metadata-scan FileIO resources after scanning. ### Check List (For Author) - Behavior changed: No - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Code, tests and this description - Human review: not stated - Prompts: Verify whether earlier release-branch findings also affect master, fix confirmed issues in one PR, and review and correct the complete change locally before submitting. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
