zhannngchen commented on code in PR #12875: URL: https://github.com/apache/doris/pull/12875#discussion_r978271412
########## be/src/olap/rowset/beta_rowset_writer.cpp: ########## @@ -346,7 +345,13 @@ Status BetaRowsetWriter::_flush_segment_writer(std::unique_ptr<segment_v2::Segme DCHECK_LE(min_key.compare(max_key), 0); key_bounds.set_min_key(min_key.to_string()); key_bounds.set_max_key(max_key.to_string()); - _segments_encoded_key_bounds.emplace_back(key_bounds); + { + std::lock_guard<SpinLock> l(_lock); + _segment_num_rows.reserve(_num_segment); Review Comment: emm... right I want to use `resize(segment_id)` at first, but resize may shrink the vector size, so changed to `reserve(segment_id)`, but ignored the fact that `reserve` won't change size of vector. -- 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