github-actions[bot] commented on code in PR #64229:
URL: https://github.com/apache/doris/pull/64229#discussion_r3377271652


##########
be/src/storage/index/inverted/inverted_index_cache.cpp:
##########
@@ -141,4 +142,17 @@ void InvertedIndexQueryCache::insert(const CacheKey& key, 
std::shared_ptr<roarin
     *handle = InvertedIndexQueryCacheHandle(this, lru_handle);
 }
 
+void InvertedIndexSearcherCache::insert_term_bf(const 
InvertedIndexSearcherCache::CacheKey& key,
+                                                
std::shared_ptr<InvertedIndexTermBloomFilter> bf,
+                                                InvertedIndexCacheHandle* 
handle) {
+    auto cache_value = std::make_unique<CacheValue>();
+    size_t charge = bf->byte_size();
+    cache_value->term_bf = std::move(bf);
+    cache_value->size = charge;
+    cache_value->last_visit_time = UnixMillis();
+    auto* lru_handle = _policy->insert(key.index_file_path, 
(void*)cache_value.release(), charge,

Review Comment:
   This inserts parsed term BF entries into the searcher cache under the 
caller-provided BF namespace key (`index_file_cache_key + "\x01tbf"` in the 
reader), but `InvertedIndexSearcherCache::erase()` still only erases the plain 
`index_file_path` key. When a segment/index is removed after compaction or 
cleanup, the searcher entry is invalidated but the BF entry remains charged in 
the same LRU until stale sweep/eviction, so removed segments can leave orphan 
BF memory behind and cache accounting no longer reflects live indexes. Please 
make the BF suffix shared with the cache layer and erase both keys (or 
otherwise register a paired cleanup path) when an index file path is erased.



-- 
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]

Reply via email to