branch-4.0: [feature](file-cache) Disable cache writes after remote scan threshold - #66209
Open
bobhan1 wants to merge 1 commit into
Open
branch-4.0: [feature](file-cache) Disable cache writes after remote scan threshold#66209bobhan1 wants to merge 1 commit into
bobhan1 wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
bobhan1
force-pushed
the
agent/pick-65058-file-cache-query-limit-4.0
branch
from
July 29, 2026 04:57
cda5693 to
472066c
Compare
Contributor
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
apache#65058) (cherry picked from commit f5c30d7)
bobhan1
force-pushed
the
agent/pick-65058-file-cache-query-limit-4.0
branch
from
July 29, 2026 08:50
472066c to
ab177ff
Compare
Contributor
Author
|
run buildall |
bobhan1
marked this pull request as ready for review
July 29, 2026 09:23
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
FE Regression Coverage ReportIncrement line coverage |
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: #65058
Problem Summary:
This backports #65058 to
branch-4.0.Remote scans can read a large amount of data from object storage. Before this change, a query that had already exceeded its useful cache-write budget could still keep writing later remote cache misses into file cache, increasing cache churn and IO overhead.
This PR adds the session variable
file_cache_query_limit_bytesto control remote-scan read-through file-cache writes per query on each BE:< 0: disabled. This is the default.= 0: do not write remote-scan cache misses into local file cache from the start of the query.> 0: allow remote-scan cache writes until the next cache block would exceed the byte threshold. Once the threshold is exceeded, later cache misses continue reading from remote storage but skip additional local file-cache writes.The limiter is query-wide within a BE and is propagated through scan, segment loading, preload, segment footer, column-reader metadata, and inverted-index metadata paths. The BE dynamic config
file_cache_query_limit_segment_meta, defaultfalse, optionally includes segment footer and segment metadata cache writes in the same limit. Profile counters expose the threshold, whether remote-only-on-miss was triggered, and specialized cache-write bytes and timers.The backport maps master storage-path and API changes to the corresponding
branch-4.0olap/veccode paths. Master-only modules that do not exist onbranch-4.0are not introduced.Release note
Add
file_cache_query_limit_bytesfor query-level remote-scan file-cache write limiting, and add optional segment metadata accounting withfile_cache_query_limit_segment_meta.Check List (For Author)
Test
Validation:
git diff --check./build.sh --be --fe --cloud -j100./run-fe-ut.sh --run org.apache.doris.qe.SessionVariablesTest,org.apache.doris.qe.ShortCircuitQueryContextTest(8 tests passed)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/remote_scan_no_write_file_cache -g docker -runMode=cloud -dockerSuiteParallel 1(2 suites passed)Behavior changed:
file_cache_query_limit_bytesis reached while continuing to read misses from remote storage. Optional segment metadata accounting can include segment footer and metadata cache writes in the same query-wide threshold.Does this need documentation?
Check List (For Reviewer who merge this PR)