yiguolei commented on code in PR #24029:
URL: https://github.com/apache/doris/pull/24029#discussion_r1322660256


##########
be/src/olap/rowset/segment_v2/inverted_index_cache.cpp:
##########
@@ -55,10 +54,11 @@ IndexSearcherPtr 
InvertedIndexSearcherCache::build_index_searcher(const io::File
     return index_searcher;
 }
 
-void InvertedIndexSearcherCache::create_global_instance(size_t capacity, 
uint32_t num_shards) {
-    DCHECK(_s_instance == nullptr);
-    static InvertedIndexSearcherCache instance(capacity, num_shards);
-    _s_instance = &instance;
+InvertedIndexSearcherCache* InvertedIndexSearcherCache::create_global_instance(
+        size_t capacity, uint32_t num_shards) {
+    DCHECK(ExecEnv::GetInstance()->get_inverted_index_searcher_cache() == 
nullptr);

Review Comment:
   and  here, not need check 



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

Reply via email to