Doris-Breakwater commented on issue #71027:
URL: https://github.com/apache/doris/issues/71027#issuecomment-7158928669

   Breakwater-GitHub-Analysis-Slot: slot_b7b06c4e91cd
   
   Source inspection confirms both ways of bypassing the scan cache-write 
budget at master `7dd131e514c` and on branch-4.1 at `1330a0785d1`. Both paths 
are also present in the branch-4.1 backport commit. The reported write rate and 
mutex contention still need runtime evidence. [4.1 
backport](https://github.com/apache/doris/commit/06ffaef2520da08fcf5b88088a4274bbcc5130d6)
   
   - **Native `INSERT INTO … SELECT`.** The FE ships the session limit in the 
query options and sets the insert's query type to `LOAD`. The BE only 
constructs the limiter for `SELECT`, even when the limit is explicitly zero. 
The native source still uses `READER_QUERY`, so `BetaRowsetReader` takes the 
query-reader path but gets a null limiter. Cold source reads are therefore 
eligible for ordinary read-through caching. Extending limiter construction to 
`LOAD` addresses this path. The external-file scan helper still gates 
attachment on `SELECT`, so please include an external-file load as a regression 
control. [FE 
insert](https://github.com/apache/doris/blob/7dd131e514c/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/AbstractInsertExecutor.java#L214-L219)
 · [BE 
limiter](https://github.com/apache/doris/blob/7dd131e514c/be/src/runtime/query_context.cpp#L132-L140)
 · [Native 
scan](https://github.com/apache/doris/blob/7dd131e514c/be/src/storage/rowset/beta_ro
 wset_reader.cpp#L216-L238) · [External 
scan](https://github.com/apache/doris/blob/7dd131e514c/be/src/exec/scan/file_scan_io_context.h#L28-L39)
   - **Cache-populating prefetch.** `prefetch_range()` queues a dry-run read 
that forces synchronous cache population and clears the borrowed limiter 
pointer. Check the caller's no-write state before submitting and keep any 
limiter used by the worker alive for the duration of the task. For positive 
budgets, charging raw range length can undercount block-aligned misses and 
overcharge hits or overlapping requests. A refused admission also permanently 
switches the limiter to remote-only mode, so an oversized speculative request 
can force later demand reads into no-write mode while budget remains. Please 
test accounting against newly admitted cache blocks. The segment flag gates the 
native query caller. Native Parquet also calls this helper and is worth 
covering if the patch changes the shared path. [Prefetch 
worker](https://github.com/apache/doris/blob/7dd131e514c/be/src/io/cache/cached_remote_file_reader.cpp#L1676-L1719)
 · [Block admission](https://github.com/apache/doris/blob/7dd131e
 514c/be/src/io/cache/block_file_cache.cpp#L1214-L1243) · [Parquet 
caller](https://github.com/apache/doris/blob/7dd131e514c/be/src/format_v2/parquet/parquet_file_context.cpp#L723-L737)
   
   Please open the PR with the BE tests and include two cold-source checks. 
First compare `SELECT` and `INSERT … SELECT` with segment prefetch off. Then 
exercise a standalone `SELECT` with segment prefetch on, using zero and a small 
positive limit. Please include the exact FE and BE builds, effective cache and 
prefetch settings, and source-segment cache writes or newly populated blocks 
before and after each run. Account for destination-writer cache fills and 
background activity when using BE-wide deltas. A BE thread dump from the same 
interval would help verify the mutex contention. Dry-run prefetch skips the 
normal read-profile update, so use cache-block state or another write-side 
measurement to verify it. `remote_scan_no_write_file_cache_query_total` only 
counts a transition on rejected admission. A zero limit starts in remote-only 
mode and leaves that counter unchanged even when it works. [Read 
statistics](https://github.com/apache/doris/blob/7dd131e514c/be/src/io/cache/cached_
 remote_file_reader.cpp#L1643-L1667) · [Counter 
semantics](https://github.com/apache/doris/blob/7dd131e514c/be/src/io/cache/remote_scan_cache_write_limiter.cpp#L27-L74)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to