Zoltan Borok-Nagy has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24838 )

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


Patch Set 6:

(4 comments)

LGTM, but my AI had some complaints. Selected the ones that I think worth 
fixing in this CR.

http://gerrit.cloudera.org:8080/#/c/24838/6/be/src/exec/hdfs-scan-node-base.cc
File be/src/exec/hdfs-scan-node-base.cc:

http://gerrit.cloudera.org:8080/#/c/24838/6/be/src/exec/hdfs-scan-node-base.cc@255
PS6, Line 255:   for (const CredentialEntry& cred : 
hdfs_table_->StorageCredentials()) {
For time-travel scans this list is empty. ForwardingFeIcebergTable should 
forward getCredentials() to the base table.


http://gerrit.cloudera.org:8080/#/c/24838/6/be/src/runtime/query-state.cc
File be/src/runtime/query-state.cc:

http://gerrit.cloudera.org:8080/#/c/24838/6/be/src/runtime/query-state.cc@159
PS6, Line 159:     HdfsFsCache::instance()->ReleaseQueryConnections(query_id());
On the coordinator the QueryState reference is only dropped in ~Coordinator, 
i.e. when the client closes the query (idle_query_timeout is 0 by default). 
Until then the query stays in VendedConnection::queries, so every connection 
the coordinator's fragment instances used is pinned, even after its credential 
has expired. A client that leaves statements open keeps them alive indefinitely.

Could we call ReleaseQueryConnections() from ReleaseBackendResources(), when 
all fragment instances are done, and keep this call as a backstop?


http://gerrit.cloudera.org:8080/#/c/24838/6/be/src/runtime/tmp-file-mgr.cc
File be/src/runtime/tmp-file-mgr.cc:

http://gerrit.cloudera.org:8080/#/c/24838/6/be/src/runtime/tmp-file-mgr.cc@496
PS6, Line 496:       HdfsFsCache::instance()->GetConnection(querylevel_dir, 
&hdfs_conn, &hdfs_conns_);
The local cache is now keyed by namenode + options, and hdfs_conns_ is seeded 
with the s3a options (TmpDirS3::GetConnection()), so this lookup without 
options no longer hits it. On the miss GetConnection() inserts into hdfs_conns_ 
after releasing the HdfsFsCache lock (hdfs-fs-cache.cc:211), while other 
threads read the same map (TmpFileRemote ctor, teardown of other queries). 
Before this change the key was the namenode only, so this was always a hit and 
the map was read-only after startup.

Could this go through tmp_dirs_remote_->GetConnection() so it uses the seeded 
key?


http://gerrit.cloudera.org:8080/#/c/24838/6/fe/src/main/java/org/apache/impala/catalog/iceberg/VendedCredentialsFileIO.java
File 
fe/src/main/java/org/apache/impala/catalog/iceberg/VendedCredentialsFileIO.java:

http://gerrit.cloudera.org:8080/#/c/24838/6/fe/src/main/java/org/apache/impala/catalog/iceberg/VendedCredentialsFileIO.java@290
PS6, Line 290:     CachedFileSystem cached = FS_CACHE.get(key);
With the new idle rule this get() + touch() is racy against closeStale(): 
another thread can evaluate isStale(), remove and close the instance between 
our get() and touch(), and we return a closed FileSystem for a credential that 
is still valid ("FileSystem is closed!" during planning).

Doing both the touch and the removal through FS_CACHE.computeIfPresent() would 
make them atomic per key (and the close could then happen outside the monitor).

Related: lastUsedMs_ is only updated when a file is opened, so a stream or 
iterator that stays open for more than an hour without a new open (e.g. a 
metadata table scan) can have its FileSystem closed underneath it.



--
To view, visit http://gerrit.cloudera.org:8080/24838
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73592a1521f29374316ed001341f956b40f9c0d5
Gerrit-Change-Number: 24838
Gerrit-PatchSet: 6
Gerrit-Owner: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Sun, 11 Oct 2026 16:23:48 +0000
Gerrit-HasComments: Yes

Reply via email to