Repository navigation
[AMORO-4268][AMS] Support HDFS owner impersonation for optimizing commits - #4333
johntomcat7408-cmyk wants to merge 9 commits into
Conversation
…mits Add opt-in table-owner proxy impersonation to AMS-side optimizing commits. Resolve the effective owner from Hive Metastore or refreshed Iceberg metadata, keep ordinary table loads unchanged, and fail without service-user fallback. Document Hadoop proxy-user requirements and cover configuration precedence, owner resolution, FileIO identity, and failure paths. Optimizer task writes and other maintenance operations remain out of scope.
sivakumar-mahalingam
left a comment
There was a problem hiding this comment.
Could we avoid unconditional icebergTable.refresh() when HDFS impersonation is not enabled?
buildCommit() now loads the table inside withOptimizingCommitImpersonation(), so the TableOwnerResolver.resolve() appears to refresh the Iceberg table on each optimizing commit before checking hdfs.impersonation.enabled
It will add extra metadata I/O/failure point even when impersonation is disabled, which is the default behavior. Could we move the refresh after the hdfs.impersonation.enabled check so it will only run when impersonation is enabled?
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@amoro.apache.org list. Thank you for your contributions. |
Why are the changes needed?
AMS currently constructs optimizing commits with tables whose Hadoop FileIO runs as the catalog service identity. In secured, table-owner-controlled warehouses, optimizer tasks can succeed while the AMS commit fails to write metadata or clean up files.
This is the first scoped part of #4268. It covers AMS-side optimizing commits only; optimizer task writes and other maintenance operations are unchanged.
Brief change log
hdfs.impersonation.enabledconfiguration, disabled by default. An explicit table value overrides the direct catalog value and the catalogtable.default.How was this patch tested?
Commands and results:
.\mvnw.cmd test -pl amoro-format-iceberg -am -Dtest=TestAuthenticatedHadoopFileIO,TestTableOwnerResolver -Dsurefire.failIfNoSpecifiedTests=false— 17 tests passed..\mvnw.cmd test -pl amoro-format-mixed/amoro-mixed-hive -am -Dtest=TestMixedHiveTablesImpersonation -Dsurefire.failIfNoSpecifiedTests=false— 2 tests passed.TestInternalIcebergHandlerImpersonation— 1 test passed in the AMS-focused run..\mvnw.cmd validate -pl amoro-format-iceberg,amoro-format-mixed/amoro-mixed-hive,amoro-ams -am— all 15 reactor modules passed Spotless and Checkstyle validation.git diff HEAD^ HEAD --check— passed.The AMS-focused run could not initialize
TestOptimizingQueue's Hive metastore on Windows becauseHADOOP_HOME/winutils.exeis unavailable. A real Kerberos/MiniDFS/HMS environment and the full test suite were not run locally.Compatibility and risks
hdfsowner is not special-cased; cluster proxy-user policy remains authoritative.Provenance and contribution boundaries
The implementation is original to this PR. It builds on the existing
TableMetaStore#doAsImpersonatingand authenticated FileIO patterns already present in upstream commit96a4d781aac60c4080b3f4a41322848e2308649a. No code was copied from open or unmerged pull requests or third-party sources.Documentation
docs/admin-guides/managing-catalogs.md