Uh oh!
There was an error while loading. Please reload this page.
[fix](be) Include HDFS connection in file handle cache key - #63516
Conversation
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: HDFS file handles were cached only by path and mtime, so a later query using a different hdfsFS authentication context could reuse a handle opened from another context when the same file path and mtime matched. ### Release note None ### Check List (For Author) - Test: Manual test - `build-support/clang-format.sh be/src/io/fs/file_handle_cache.cpp be/src/io/fs/file_handle_cache.h be/test/io/fs/file_handle_cache_test.cpp` - `git diff --cached --check` - BE UT not run locally per request - Behavior changed: No - Does this need documentation: No
hello-stephen
commented
May 22, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
suxiaogang223
commented
May 22, 2026
run be-ut |
suxiaogang223
commented
May 22, 2026
run buildall |
hello-stephen
commented
May 22, 2026
TPC-H: Total hot run time: 31854 ms |
hello-stephen
commented
May 22, 2026
TPC-DS: Total hot run time: 169339 ms |
hello-stephen
commented
May 22, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
May 22, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Gabriel39
commented
May 25, 2026
/review |
There was a problem hiding this comment.
Automated review result: no blocking issues found.
Critical checkpoint conclusions:
- Goal and proof: The PR addresses HDFS file-handle cache reuse across different hdfsFS/authentication contexts by including hdfsFS in both the cache key and partition hash. The added BE unit test verifies key equality changes for hdfsFS, path, and mtime.
- Scope and clarity: The change is small and focused on the file-handle cache keying logic.
- Concurrency: The existing LruMultiCache locking model is preserved; the change only affects key construction and partition selection before acquiring the partition cache lock. No new shared mutable state or lock ordering is introduced.
- Lifecycle/static initialization: The existing function-local static cache in HdfsFileReader is unchanged. The hdfsFS handle is already owned by HdfsMgr/HdfsHandler, and this PR does not introduce new static/global objects.
- Configuration/compatibility: No new configuration, protocol, storage format, or FE-BE compatibility concerns.
- Parallel paths: The only HDFS reader cache entry point goes through HdfsFileReader::create -> get_file -> FileHandleCache::get_file_handle, so the changed path covers the relevant use.
- Tests: New BE unit test is included under be/test and should be picked up by the existing GLOB_RECURSE UT_FILES. I also ran
git diff --check cbe23a31d8d37f4e25bcc40e945d6559299903b7 origin/pr/63516with no whitespace errors. Full BE UT was not run in this review environment. - Observability: No additional observability appears necessary for this small keying fix; existing VLOG close/unbuffer logging remains intact.
- Data correctness/transactions/persistence: Not applicable; no transaction, version, MoW, or persistence behavior is modified.
- Performance: The additional pointer hash/key comparison is negligible and avoids incorrect cross-context reuse.
User focus points: no additional user-provided review focus was specified.
Uh oh!
There was an error while loading. Please reload this page.
HDFS file handles were cached only by file path and mtime. In a pipeline that runs multiple Hive catalog cases against the same HDFS path shape, a later query can use a different `hdfsFS` authentication context while still matching the old cache key. That can reuse a handle opened under another context and lead to HDFS auth failures such as `SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS]`. This PR includes the `hdfsFS` identity in the file handle cache key and partition hash, so cached handles are only reused within the same filesystem/authentication context.
HDFS file handles were cached only by file path and mtime. In a pipeline that runs multiple Hive catalog cases against the same HDFS path shape, a later query can use a different `hdfsFS` authentication context while still matching the old cache key. That can reuse a handle opened under another context and lead to HDFS auth failures such as `SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS]`. This PR includes the `hdfsFS` identity in the file handle cache key and partition hash, so cached handles are only reused within the same filesystem/authentication context.
) HDFS file handles were cached only by file path and mtime. In a pipeline that runs multiple Hive catalog cases against the same HDFS path shape, a later query can use a different `hdfsFS` authentication context while still matching the old cache key. That can reuse a handle opened under another context and lead to HDFS auth failures such as `SIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS]`. This PR includes the `hdfsFS` identity in the file handle cache key and partition hash, so cached handles are only reused within the same filesystem/authentication context.
What problem does this PR solve?
HDFS file handles were cached only by file path and mtime. In a pipeline that runs multiple Hive catalog cases against the same HDFS path shape, a later query can use a different
hdfsFSauthentication context while still matching the old cache key. That can reuse a handle opened under another context and lead to HDFS auth failures such asSIMPLE authentication is not enabled. Available:[TOKEN, KERBEROS].This PR includes the
hdfsFSidentity in the file handle cache key and partition hash, so cached handles are only reused within the same filesystem/authentication context.Issue Number: None
Related PR: None
Release note
None
Check List (For Author)
build-support/clang-format.sh be/src/io/fs/file_handle_cache.cpp be/src/io/fs/file_handle_cache.h be/test/io/fs/file_handle_cache_test.cpp