[fix](hdfs) Remove query profile from HDFS file reader - #67335
Merged
gavinchou merged 1 commit intoAug 31, 2026
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
### What problem does this PR solve? Issue Number: None Related PR: apache#67293 Problem Summary: `CachedRemoteFileReader::prefetch_range()` submits fire-and-forget dry-run tasks that can outlive the query `RuntimeProfile`. `HdfsFileReader` stored raw pointers to query-profile timers and counters, so a delayed prefetch read could update them after the query profile had been destroyed and trigger a use-after-free. Remove the query `RuntimeProfile` dependency and HDFS-specific query-profile timers and counters from `HdfsFileReader`, remove the unused profile passthrough from `HdfsFileSystem`, and update all affected call sites. Generic file-reader and file-cache statistics plus process-wide HDFS bvars remain unchanged. ### Release note None ### Check List (For Author) - Test: Manual test - `build-support/clang-format.sh` - `build-support/check-format.sh` - `build-support/check-build-hygiene.sh` - `git diff --check upstream/master...HEAD` - Behavior changed: Yes. Query profiles no longer expose the HDFS-specific `HdfsIO` timer and HDFS read-statistics counters; HDFS reads and file-cache behavior are unchanged. - Does this need documentation: No (cherry picked from commit 4e45489)
bobhan1
force-pushed
the
fix/doris-28268-hdfs-prefetch-profile-uaf-master
branch
from
August 31, 2026 07:49
4dcc5db to
096a785
Compare
16 tasks
Contributor
Author
|
run buildall |
yiguolei
pushed a commit
that referenced
this pull request
Aug 31, 2026
…67293) ### What problem does this PR solve? pick #67335 Issue Number: DORIS-28268 Related PR: None Problem Summary: `CachedRemoteFileReader::prefetch_range()` submits fire-and-forget dry-run tasks. A running task keeps the cached reader and its underlying `HdfsFileReader` alive, but it does not keep the query `RuntimeProfile` alive. Because `HdfsFileReader` stored raw pointers to query-profile timers and counters, a delayed prefetch read could update them after the query profile had been destroyed and trigger a use-after-free. Remove the query `RuntimeProfile` dependency and HDFS-specific query-profile timers/counters from `HdfsFileReader`. This also removes the now-unused profile passthrough from `HdfsFileSystem` and updates all affected call sites. Generic file-reader/file-cache statistics and process-wide HDFS bvars remain unchanged; HDFS reads and cache behavior are unchanged. ### Release note None ### Check List (For Author) - Test - [ ] Regression test - [ ] Unit Test - [x] Manual test (add detailed scripts or steps below) - `clang-format --dry-run --Werror` on all changed C++ files - `git diff --check` - `./build.sh --be -j100`: the changed HDFS reader/filesystem and affected call-site translation units compiled successfully. The full local BE build is blocked by an unrelated installed Lance C header mismatch (`LanceScanStatistics` and statistics callback definitions are missing from the local `lance.h`). - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason - Behavior changed: - [ ] No. - [x] Yes. Query profiles no longer expose the HDFS-specific `HdfsIO` timer and HDFS read-statistics counters. HDFS read and file-cache behavior are unchanged. - Does this need documentation? - [x] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label
bobhan1
marked this pull request as ready for review
August 31, 2026 10:23
bobhan1
requested review from
Gabriel39,
gavinchou and
liaoxin01
as code owners
August 31, 2026 10:23
gavinchou
approved these changes
Aug 31, 2026
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
TPC-H: Total hot run time: 17041 ms |
Contributor
TPC-DS: Total hot run time: 83296 ms |
Contributor
ClickBench: Total hot run time: 14.68 s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: None
Related PR: #67293
Problem Summary:
CachedRemoteFileReader::prefetch_range()submits fire-and-forget dry-run tasks. A running task keeps the cached reader and its underlyingHdfsFileReaderalive, but it does not keep the queryRuntimeProfilealive. BecauseHdfsFileReaderstored raw pointers to query-profile timers and counters, a delayed prefetch read could update them after the query profile had been destroyed and trigger a use-after-free.Remove the query
RuntimeProfiledependency and HDFS-specific query-profile timers and counters fromHdfsFileReader. This also removes the now-unused profile passthrough fromHdfsFileSystemand updates all affected call sites. Generic file-reader and file-cache statistics plus process-wide HDFS bvars remain unchanged; HDFS reads and cache behavior are unchanged.The forward-port conflict in
hdfs_file_reader.cppwas resolved by preserving master's WorkloadGroup/ResourceContext includes and master's removal of the oldcompile_check_begin/endpair while applying #67293's profile-removal semantics.Release note
None
Check List (For Author)
build-support/clang-format.shbuild-support/check-format.shbuild-support/check-build-hygiene.shgit diff --check upstream/master...HEAD./build.sh --be -j100with the existing Release build typeHdfsIOtimer and HDFS read-statistics counters. HDFS reads and file-cache behavior are unchanged.Check List (For Reviewer who merge this PR)