xinyiZzz commented on code in PR #44739:
URL: https://github.com/apache/doris/pull/44739#discussion_r1862883241


##########
be/src/olap/metadata_adder.h:
##########
@@ -207,18 +213,24 @@ void MetadataAdder<T>::add_num(int64_t val) {
     }
     if constexpr (std::is_same_v<T, RowsetMeta>) {
         g_rowset_meta_num << val;
+        ExecEnv::GetInstance()->all_rowsets_mem_tracker()->consume(val);

Review Comment:
   2个目的,
   一是实时性,tracker是要有一定实时性的,否则每次都要手动refresh,不能保证其他人用tracker会记得要refresh
   二是维护性,如果单独搞一个方法refresh,把几个bvar的值相加,那其他人在 metadata_adder.h 
新增元数据类的时候,不一定会想着同步修改refresh方法



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