platoneko commented on code in PR #30244: URL: https://github.com/apache/doris/pull/30244#discussion_r1461937342
########## be/src/olap/tablet.cpp: ########## @@ -2336,8 +2336,21 @@ bool Tablet::_has_data_to_cooldown() { int64_t min_local_version = std::numeric_limits<int64_t>::max(); RowsetSharedPtr rowset; std::shared_lock meta_rlock(_meta_lock); + // Ususally once the tablet has done cooldown successfully then the first + // rowset would always be remote rowset + bool has_cooldowned = false; + for (const auto& [_, rs] : _rs_version_map) { + if (!rs->is_local()) { + has_cooldowned = true; + break; + } + } Review Comment: 直接在一次遍历的时候,找到本地最小的,和tablet所有rowset中最大的,如果本地最小的也是tablet所有rowset中最大的就返回true吧 -- 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