branch-4.1: [improvement](topn) Add option to skip file cache writes in lazy materialization - #66414
Merged
yiguolei merged 1 commit intoAug 5, 2026
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
August 4, 2026 03:58
Contributor
Author
|
run buildall |
Contributor
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
Author
|
run external |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
FE Regression Coverage ReportIncrement line coverage |
yiguolei
approved these changes
Aug 5, 2026
11 tasks
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.1. This adds an option for TopN lazy materialization phase 2 to read remote cache misses without populating File Cache, and exposes the corresponding profile metrics.The cherry-pick conflicts were adapted to the
branch-4.1layouts:RowIDFetcher, while propagatingfile_cache_miss_policyto Doris-format reads.SegmentAPI and preserve the copiedIOContextwhen setting reader type, stats, and cache-miss policy.branch-4.1VariableMgr.VarAttrannotation for the new session variable.Release note
Add
enable_topn_lazy_mat_phase2_no_write_file_cacheto skip File Cache population for remote misses during TopN lazy materialization phase 2.Check List (For Author)
Validation:
./build.sh --fe -j100./build.sh --be --clean -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' -j100(9 tests passed)./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(1 suite passed)Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)