deardeng commented on code in PR #67313:
URL: https://github.com/apache/doris/pull/67313#discussion_r3888492986


##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -2244,17 +2234,19 @@ void BlockFileCache::check_disk_resource_limit() {
         config::file_cache_enter_disk_resource_limit_mode_percent = 88;
         config::file_cache_exit_disk_resource_limit_mode_percent = 80;
     }

Review Comment:
   The mechanism is right: try_reserve() does size = 5 * size and passes that 
value to QueryFileCacheContext::reserve(), while add_cell() creates a cell of 
the original size, so DCHECK(iter->size == cell_size) at 
block_file_cache.cpp:1483 can fire and release builds mis-account query usage.
   
   But it is not masked on master by the capacity-slack pre-clear. The 
pre-clear only runs before statfs is read; the is_insufficient() branch 
immediately below sets _disk_resource_limit_mode = true again whenever space or 
inode usage is at or above the enter threshold, regardless of capacity slack. 
So on master, with enable_file_cache_query_limit = true and a disk at or above 
85%, this path is already live — which is exactly the configuration of the 
cluster this series comes from. This PR widens reachability from >= enter to 
also cover the [exit, enter) hold band; it does not create the defect.
   
   Fixing it properly means separating the eviction target from the admitted 
size in try_reserve() — the get_cache_size() + size <= get_max_cache_size() 
check and both query_context->reserve() call sites all need the original block 
size. That is a different change to a different function, so it goes in its own 
PR rather than folding an unrelated query-accounting fix into a hysteresis fix.



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