branch-4.1: [fix](hdfs) Remove query profile from HDFS file reader - #67293
Merged
yiguolei merged 1 commit intoAug 31, 2026
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
bobhan1
marked this pull request as ready for review
August 28, 2026 10:35
Contributor
Author
|
run buildall |
gavinchou
previously approved these changes
Aug 28, 2026
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
gavinchou
self-requested a review
August 30, 2026 12:51
gavinchou
reviewed
Aug 30, 2026
bobhan1
force-pushed
the
fix/doris-28268-hdfs-prefetch-profile-uaf
branch
from
August 31, 2026 02:40
2e5a7e5 to
4e45489
Compare
gavinchou
approved these changes
Aug 31, 2026
yiguolei
approved these changes
Aug 31, 2026
Contributor
|
run buildall |
17 tasks
bobhan1
added a commit
to bobhan1/doris
that referenced
this pull request
Aug 31, 2026
### 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)
gavinchou
approved these changes
Aug 31, 2026
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
gavinchou
pushed a commit
that referenced
this pull request
Aug 31, 2026
Related PR: #67293 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 and counters from `HdfsFileReader`. This also removes the now-unused profile passthrough from `HdfsFileSystem` and 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.cpp` was resolved by preserving master's WorkloadGroup/ResourceContext includes and master's removal of the old `compile_check_begin/end` pair while applying #67293's profile-removal semantics.
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?
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 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/counters fromHdfsFileReader. This also removes the now-unused profile passthrough fromHdfsFileSystemand 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
clang-format --dry-run --Werroron all changed C++ filesgit 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 (LanceScanStatisticsand statistics callback definitions are missing from the locallance.h).Behavior changed:
HdfsIOtimer and HDFS read-statistics counters. HDFS read and file-cache behavior are unchanged.Does this need documentation?
Check List (For Reviewer who merge this PR)