luozenglin commented on code in PR #14920: URL: https://github.com/apache/doris/pull/14920#discussion_r1043054888
########## be/src/io/cache/sub_file_cache.cpp: ########## @@ -199,23 +208,29 @@ Status SubFileCache::_get_need_cache_offsets(size_t offset, size_t req_size, } Status SubFileCache::clean_timeout_cache() { + SubGcQueue gc_queue; + _gc_lru_queue.swap(gc_queue); std::vector<size_t> timeout_keys; { std::shared_lock<std::shared_mutex> rlock(_cache_map_lock); for (std::map<size_t, int64_t>::const_iterator iter = _last_match_times.cbegin(); iter != _last_match_times.cend(); ++iter) { if (time(nullptr) - iter->second > _alive_time_sec) { timeout_keys.emplace_back(iter->first); + } else { + auto [cache_file, done_file] = _cache_path(iter->first); + _gc_lru_queue.push({iter->first, iter->second}); Review Comment: _gc_lru_queue is used to gc no timeout cache when the cache file exceeds the disk limit. -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org