github-actions[bot] commented on code in PR #69587:
URL: https://github.com/apache/doris/pull/69587#discussion_r4597294741


##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -1523,9 +1577,10 @@ bool BlockFileCache::try_reserve(const UInt128Wrapper& 
hash, const CacheContext&
 
     /// Select the cache from the LRU queue held by query for expulsion.
     for (auto iter = query_context->queue().begin(); iter != 
query_context->queue().end(); iter++) {
-        if (!is_overflow()) {
+        if (!is_overflow() || budget.exhausted()) {

Review Comment:
   [P2] Preserve progress when bounding the per-query eviction scan
   
   With `enable_file_cache_query_limit` enabled and a full cache/query at its 
byte limit, a held prefix at least as long as the scan budget now prevents 
every subsequent miss from caching, even when released blocks follow it. For 
example, with budget 3 and a full 10-block NORMAL cache, hold query blocks 0-2 
and release downloaded blocks 3-9. This loop always stops after blocks 0-2 
without removing or moving their query-LRU records; the fallback receives the 
exhausted budget and cannot free any space, so `split_range_into_cells` returns 
`SKIP_CACHE`. The next miss repeats exactly the same scan. The same problem 
applies to a 4096-entry prefix with the default budget. Global queue rotation 
cannot help because `QueryFileCacheContext` owns a separate queue. Preserve 
bounded progress in that query queue too, by rotating skipped query iterators 
or retaining a cursor, and add a query-limit test showing a later reservation 
reaches the released tail.



-- 
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