Peter Rozsa has uploaded a new patch set (#12). ( 
https://gerrit.cloudera.org/24838 )

Change subject: IMPALA-15145: Propagate credential metadata to Scan Nodes / 
Execution Plan
......................................................................

IMPALA-15145: Propagate credential metadata to Scan Nodes / Execution Plan

Wires the credentials vended by an Iceberg REST catalog (IMPALA-15144)
through to the S3 connections used during planning and execution.

Backend:
- HdfsTableDescriptor reads TIcebergTable.credentials into
  CredentialEntry objects (prefix, fs.s3a.* config, expiry).
- New per-query QueryCredentials, owned by QueryState. QueryState
  registers the credentials of every table in the descriptor table
  (scanned tables and DML targets) before it starts its fragment
  instances, so every backend knows them whichever operators it runs.
  The coordinator also registers the DML target before finalization.
  Lookups are a longest-prefix match on path-component boundaries.
- HdfsFsCache::GetConnection() takes an optional QueryState and
  resolves the credential for the path: vended entry, then
  S3ConnCredentials, then core-site.xml. Vended connections are private
  instances keyed by prefix plus a digest of the key material, built
  outside of the cache lock, and disconnected once no live query holds
  them and their credential has expired or they were idle for an hour.
  A query releases them when its fragment instances are done.
- QueryState is passed to the GetConnection() calls on the query path:
  scans, delete vector reads, table sinks and DML finalization.
  HdfsConnOptions becomes a std::map; spill-to-S3 keeps passing its
  options per call.
- The file handle cache keys handles by the connection they were opened
  on, besides file name and mtime, so a handle is never reused with
  another credential. Files of other tables are only read through one
  connection, so their caching does not change. The handles of a vended
  connection are closed before it is disconnected (new
  LruMultiCache::EvictIf()).

Frontend:
- New VendedCredentialsFileIO, a HadoopFileIO wrapper set as the
  catalog's io-impl when vending is enabled (an explicit io-impl is
  kept). It opens each file with the credential whose prefix covers it,
  using FileSystem instances cached by bucket and credential identity
  and closed once expired or idle. Other paths fall through to
  HadoopFileIO. IcebergFileMetadataLoader lists files through the same
  instances. The FileIO offers no bulk and prefix operations, as those
  would bypass the credentials: Iceberg then cleans up the files of a
  failed commit one by one through deleteFile().
- ForwardingFeIcebergTable forwards getCredentials() for time travel.
- Server-returned credentials are ignored when
  iceberg.rest-catalog.vended-credentials-enabled is false.

Tests:
- New query-credentials-test; hdfs-fs-cache-test and
  lru-multi-cache-test cover vended connections, their file handles and
  EvictIf().
- New VendedCredentialsFileIOTest for the offered operations and the
  paths without a credential.
- tmp-file-mgr-test seeds its fake S3 connection under the new cache
  key.
- test_iceberg_rest_catalog runs with vended-credentials-enabled=true
  against the in-tree REST server, which vends nothing.
- Manually tested scans and INSERTs against Lakekeeper + RustFS.

Change-Id: I73592a1521f29374316ed001341f956b40f9c0d5
Assisted-by: Claude Fable 5.1 <[email protected]>
---
M be/src/exec/blob-reader.h
M be/src/exec/hdfs-scan-node-base.cc
M be/src/exec/iceberg-delete-builder.cc
M be/src/exec/puffin/puffin-writer.cc
M be/src/exec/table-sink-base.cc
M be/src/runtime/CMakeLists.txt
M be/src/runtime/coordinator.cc
M be/src/runtime/descriptors.cc
M be/src/runtime/descriptors.h
M be/src/runtime/dml-exec-state.cc
M be/src/runtime/dml-exec-state.h
M be/src/runtime/hdfs-fs-cache-test.cc
M be/src/runtime/hdfs-fs-cache.cc
M be/src/runtime/hdfs-fs-cache.h
M be/src/runtime/io/disk-io-mgr.cc
M be/src/runtime/io/disk-io-mgr.h
M be/src/runtime/io/handle-cache.h
M be/src/runtime/io/handle-cache.inline.h
A be/src/runtime/query-credentials-test.cc
A be/src/runtime/query-credentials.cc
A be/src/runtime/query-credentials.h
M be/src/runtime/query-state.cc
M be/src/runtime/query-state.h
M be/src/runtime/tmp-file-mgr-test.cc
M be/src/runtime/tmp-file-mgr.cc
M be/src/runtime/tmp-file-mgr.h
M be/src/util/hdfs-bulk-ops.cc
M be/src/util/hdfs-bulk-ops.h
M be/src/util/lru-multi-cache-test.cc
M be/src/util/lru-multi-cache.h
M be/src/util/lru-multi-cache.inline.h
M fe/src/main/java/org/apache/impala/catalog/IcebergFileMetadataLoader.java
M fe/src/main/java/org/apache/impala/catalog/IcebergTimeTravelTable.java
M fe/src/main/java/org/apache/impala/catalog/iceberg/IcebergRESTCatalog.java
M fe/src/main/java/org/apache/impala/catalog/iceberg/RESTCatalogProperties.java
A 
fe/src/main/java/org/apache/impala/catalog/iceberg/VendedCredentialsFileIO.java
M fe/src/main/java/org/apache/impala/catalog/local/IcebergMetaProvider.java
M 
fe/src/test/java/org/apache/impala/catalog/iceberg/TestRESTCatalogProperties.java
A 
fe/src/test/java/org/apache/impala/catalog/iceberg/VendedCredentialsFileIOTest.java
A testdata/configs/catalog_configs/iceberg_rest_vended_config/rest.properties
M tests/custom_cluster/test_iceberg_rest_catalog.py
41 files changed, 2,194 insertions(+), 116 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/38/24838/12
--
To view, visit https://gerrit.cloudera.org/24838
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I73592a1521f29374316ed001341f956b40f9c0d5
Gerrit-Change-Number: 24838
Gerrit-PatchSet: 12
Gerrit-Owner: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to