yiguolei commented on code in PR #67670:
URL: https://github.com/apache/doris/pull/67670#discussion_r4120636800
##########
be/src/util/lru_cache.cpp:
##########
@@ -305,21 +312,39 @@ void LRUCache::_lru_append(LRUHandle* list, LRUHandle* e)
{
}
Cache::Handle* LRUCache::lookup(const CacheKey& key, uint32_t hash) {
+ _lookup_count.fetch_add(1, std::memory_order_relaxed);
+ {
+ std::shared_lock l(_mutex);
+ LRUHandle* e = _table.lookup(key, hash);
+ if (e == nullptr) {
+ // LRU-K misses must update the visits list under the exclusive
lock.
+ if (!_is_lru_k) {
+ _miss_count.fetch_add(1, std::memory_order_relaxed);
+ return nullptr;
+ }
+ } else {
+ DCHECK(e->in_cache);
Review Comment:
这里if (e->refs == 1) {
// only in LRU free list, remove it from list
_lru_remove(e);
} 这个逻辑没了?
--
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]