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


##########
be/src/olap/rowset/beta_rowset.cpp:
##########
@@ -70,23 +74,73 @@ Status BetaRowset::init() {
 }
 
 Status BetaRowset::get_segment_num_rows(std::vector<uint32_t>* segment_rows) {
-    DCHECK(_rowset_state_machine.rowset_state() == ROWSET_LOADED);
+    RETURN_IF_ERROR(load_segments_info());
+    segment_rows->assign(_segments_rows.cbegin(), _segments_rows.cend());
+    return Status::OK();
+}
 
-    RETURN_IF_ERROR(_load_segment_rows_once.call([this] {
+Status BetaRowset::load_segments_info() {
+    DCHECK_NE(_rowset_state_machine.rowset_state(), ROWSET_UNLOADED);

Review Comment:
   DCHECK(_rowset_state_machine.rowset_state() == ROWSET_LOADED); 更好一些。
   有的时候,万一有3个状态,unloaded,也不意味着是loaded



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