zhannngchen commented on code in PR #20907: URL: https://github.com/apache/doris/pull/20907#discussion_r1247374629
########## be/src/olap/compaction.cpp: ########## @@ -574,16 +577,47 @@ Status Compaction::modify_rowsets(const Merger::Statistics* stats) { RETURN_IF_ERROR(_tablet->check_rowid_conversion(_output_rowset, location_map)); location_map.clear(); + { std::lock_guard<std::mutex> wrlock_(_tablet->get_rowset_update_lock()); std::lock_guard<std::shared_mutex> wrlock(_tablet->get_header_lock()); SCOPED_SIMPLE_TRACE_IF_TIMEOUT(TRACE_TABLET_LOCK_THRESHOLD); + // Here we will calculate all the rowsets delete bitmaps which are committed but not published to reduce the calculation pressure + // of publish phase. + // All rowsets which need to recalculate have been published so we don't need to acquire lock. + // Step1: collect this tablet's all committed rowsets' delete bitmaps + CommitTabletTxnInfoVec commit_tablet_txn_info_vec {}; + StorageEngine::instance()->txn_manager()->get_all_commit_tablet_txn_info_by_tablet( + _tablet, commit_tablet_txn_info_vec); + + // Step2: calculate all rowsets' delete bitmaps which are published during compaction. + int64_t cur_max_version = _tablet->max_version().second; + RowsetIdUnorderedSet rowset_ids = _tablet->all_rs_id(cur_max_version); Review Comment: should not replace the rowset_ids with `_tablet->all_rs_id(cur_max_version)` -- 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