github-actions[bot] commented on code in PR #64578:
URL: https://github.com/apache/doris/pull/64578#discussion_r3435956642
##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -746,15 +759,15 @@ std::string BlockFileCache::clear_file_cache_async() {
FileBlockSPtr file_block = cell->file_block;
if (file_block) {
std::lock_guard block_lock(file_block->_mutex);
- remove(file_block, cache_lock, block_lock, false);
+ remove(file_block, cache_lock, block_lock, sync_remove);
++num_cells_to_delete;
}
}
clear_need_update_lru_blocks();
}
std::stringstream ss;
- ss << "finish clear_file_cache_async, path=" << _cache_base_path
+ ss << "finish " << action << ", path=" << _cache_base_path << "
sync_remove=" << sync_remove
<< " num_files_all=" << num_files_all << " num_cells_all=" <<
num_cells_all
Review Comment:
The removed `clear_file_cache_directly()` refreshed
`_cur_cache_size_metrics` and all queue-size/count gauges before returning, so
callers could observe the cleared state immediately. This new sync path only
mutates `_cur_cache_size` and the LRU queues through `remove()`; those
`bvar::Status` gauges are next updated by `run_background_monitor()` after
`file_cache_background_monitor_interval_ms` (5s by default). As a result,
`op=clear&sync=true` can return `OK` while `get_stats()`/metrics still report
the old cache sizes until the monitor thread wakes up. Please refresh the same
gauges from the current counters/queues before returning from the sync clear
path.
--
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]