zhannngchen commented on code in PR #44776:
URL: https://github.com/apache/doris/pull/44776#discussion_r1867677310
##########
be/src/olap/compaction.cpp:
##########
@@ -872,6 +875,60 @@ void
Compaction::construct_index_compaction_columns(RowsetWriterContext& ctx) {
}
}
+Status CompactionMixin::update_delete_bitmap() {
+ // for mow with cluster keys, compaction read data with delete bitmap
+ // if tablet is not ready(such as schema change), we need to update delete
bitmap
+ {
+ std::shared_lock meta_rlock(_tablet->get_header_lock());
+ if (_tablet->tablet_state() != TABLET_NOTREADY) {
+ return Status::OK();
+ }
+ }
+ OlapStopWatch watch;
+ std::vector<RowsetSharedPtr> rowsets;
+ for (const auto& rowset : _input_rowsets) {
+ std::lock_guard rwlock(tablet()->get_rowset_update_lock());
+ std::shared_lock rlock(_tablet->get_header_lock());
+ Status st = _tablet->update_delete_bitmap_without_lock(_tablet,
rowset, &rowsets);
+ if (!st.ok()) {
+ LOG(INFO) << "failed update_delete_bitmap_without_lock for
tablet_id="
+ << _tablet->tablet_id() << ", st=" << st.to_string();
+ return st;
+ }
+ rowsets.push_back(rowset);
+ }
+ LOG(INFO) << "finish update delete bitmap for tablet: " <<
_tablet->tablet_id()
+ << ", rowsets: " << _input_rowsets.size() << ", cost: " <<
watch.get_elapse_time_us()
+ << "(us)";
+ return Status::OK();
+}
+
+Status CloudCompactionMixin::update_delete_bitmap() {
+ // for mow with cluster keys, compaction read data with delete bitmap
+ // if tablet is not ready(such as schema change), we need to update delete
bitmap
+ {
+ std::shared_lock meta_rlock(_tablet->get_header_lock());
+ if (_tablet->tablet_state() != TABLET_NOTREADY) {
+ return Status::OK();
+ }
+ }
+ OlapStopWatch watch;
+ std::vector<RowsetSharedPtr> rowsets;
+ for (const auto& rowset : _input_rowsets) {
+ Status st = _tablet->update_delete_bitmap_without_lock(_tablet,
rowset, &rowsets);
Review Comment:
need to hold the header lock?
--
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]