github-actions[bot] commented on code in PR #69196:
URL: https://github.com/apache/doris/pull/69196#discussion_r4357219062
##########
be/src/io/fs/file_meta_cache.h:
##########
@@ -25,10 +28,21 @@ namespace doris {
// A file meta cache depends on a LRU cache.
// Such as parsed parquet footer.
-// The capacity will limit the number of cache entries in cache.
+// Capacity is measured in bytes in memory mode, or entries in legacy mode.
+// Active readers pin entries; the LRU converges to capacity as their handles
are released.
class FileMetaCache {
public:
- FileMetaCache(int64_t capacity) : _cache(capacity) {}
+ explicit FileMetaCache(int64_t capacity, LRUCacheType type =
LRUCacheType::NUMBER,
+ uint32_t num_shards = DEFAULT_LRU_CACHE_NUM_SHARDS)
+ : _cache(capacity, num_shards, type,
CachePolicy::CacheType::EXTERNAL_FILE_META_CACHE),
Review Comment:
[P1] Keep the previous cache-clear name safe after reclassification
Registering this cache only as `EXTERNAL_FILE_META_CACHE` leaves
`COMMON_OBJ_LRU_CACHE` without an instance: `FileMetaCache` is the only
production `ObjLRUCache` owner. The existing `GET
/api/clear_cache/CommonObjLRUCache` still passes
`CachePolicy::string_to_type()`, but `CacheManager::cache_prune_all()` then
obtains `nullptr` from `_caches[type]` and dereferences it in `prune_all()`,
crashing BE. Preserve a compatible alias or safely handle the missing
registration when changing the category, and add coverage for the old request.
--
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]