jacktengg commented on code in PR #31122: URL: https://github.com/apache/doris/pull/31122#discussion_r1495508407
########## be/src/olap/lru_cache.h: ########## @@ -246,15 +252,19 @@ struct LRUHandle { struct LRUHandle* prev = nullptr; // previous entry in lru list size_t charge; size_t key_length; - size_t total_size; // including key length - size_t bytes; // Used by LRUCacheType::NUMBER, LRUCacheType::SIZE equal to total_size. - bool in_cache; // Whether entry is in the cache. + size_t total_size; // Entry charge, used to limit cache capacity, LRUCacheType::SIZE including key length. + size_t bytes; // Used by LRUCacheType::NUMBER, LRUCacheType::SIZE equal to total_size. + bool in_cache; // Whether entry is in the cache. uint32_t refs; uint32_t hash; // Hash of key(); used for fast sharding and comparisons CachePriority priority = CachePriority::NORMAL; MemTrackerLimiter* mem_tracker; LRUCacheType type; + // Save the last visit time of this cache entry. + // Use atomic because it may be modified by multi threads. + int64_t last_visit_time; Review Comment: atomic or not? -- 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