branch-4.0: [improvement](topn) Add option to skip file cache writes in topn lazy materialization - #66172
Open
bobhan1 wants to merge 1 commit into
Open
Conversation
… materialization (apache#65021) This PR adds an opt-in session variable for TopN lazy materialization phase-2 file-cache miss handling. - add `enable_topn_lazy_mat_phase2_no_write_file_cache` - keep the option disabled by default, so existing behavior is unchanged - when the option is enabled, phase-2 lazy materialization uses already-downloaded file-cache blocks for full local hits and reads remote data directly on cache miss without writing the file cache - expose aggregate and per-BE phase-2 rows, segments, and file-cache counters in the `MaterializeNode` profile - accumulate per-BE stats across multiple phase-2 fetch calls - cover both row-store and column-store fetch paths - `./build.sh --be --fe --cloud -j100` - before packaging, verified no `output/fe/conf/fe_custom.conf`, no `output/be/conf/be_custom.conf`, empty `output/fe/doris-meta`, and empty `output/be/storage` - for docker regression image, verified FE/BE debug-point config and BE Java support config: - `output/fe/conf/fe.conf`: `enable_debug_points=true` - `output/be/conf/be.conf`: `enable_debug_points=true`, `enable_java_support=false` - `docker build -f docker/runtime/doris-compose/Dockerfile -t bh-cluster-2 .` - `env -u HTTP_PROXY -u HTTPS_PROXY -u http_proxy -u https_proxy -u ALL_PROXY -u all_proxy ./run-regression-test.sh --run -d cloud_p0/cache/topn_lazy_file_cache -s test_topn_lazy_mat_phase2_no_write_file_cache -g docker -runMode=cloud -dockerSuiteParallel 1` - `All suites success` - `Test 1 suites, failed 0 suites, fatal 0 scripts, skipped 0 scripts` - `./run-be-ut.sh --run --filter=MaterializationSharedStateTest.*:BlockFileCacheTest.get_downloaded_blocks_if_fully_covered_is_read_only:BlockFileCacheTest.cached_remote_file_reader_remote_only_on_miss:BlockFileCacheTest.fd_cache_remove:BlockFileCacheTest.fd_cache_evict -j100` - `PASSED 9 tests` (cherry picked from commit f45888f)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
bobhan1
marked this pull request as ready for review
July 28, 2026 11:24
Contributor
Author
|
run buildall |
Contributor
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
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: N/A
Related PR: #65021
Problem Summary:
Backport #65021 to
branch-4.0.This adds the
enable_topn_lazy_mat_phase2_no_write_file_cachesession variable. When enabled, remote cache misses during the second phase of TopN lazy materialization are read without writing the fetched data into file cache, while existing cache hits continue to be read locally. The backport keeps thebranch-4.0pipeline/segment layout, block type, and file-cache statistics interfaces.Validation:
./build.sh --be --fe --cloud -j100./run-be-ut.sh --run --filter='MaterializationSharedStateTest.*:BlockFileCacheTest.get_downloaded_blocks_if_fully_covered_is_read_only:BlockFileCacheTest.cached_remote_file_reader_remote_only_on_miss:BlockFileCacheTest.fd_cache_remove:BlockFileCacheTest.fd_cache_evict' -j40(9 tests passed)./run-regression-test.sh --run -d cloud_p0/cache -s test_topn_lazy_mat_phase2_no_write_file_cache -g docker -runMode=cloud -dockerSuiteParallel 1 -image baohan-doris-regression:pr65021-4.0(1 suite passed)build-support/clang-format.shgit diff --checkRelease note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)