liaoxin01 commented on code in PR #18643: URL: https://github.com/apache/doris/pull/18643#discussion_r1166217957
########## be/src/olap/delta_writer.cpp: ########## @@ -380,6 +382,23 @@ Status DeltaWriter::close_wait(const PSlaveTabletNodes& slave_tablet_nodes, _request_slave_tablet_pull_rowset(node_info); } } + // do calc delete bitmap in segments here + // generate delete bitmap, build a tmp rowset and load recent segment + if (!_tablet->enable_unique_key_merge_on_write()) { + return Status::OK(); + } + auto rowset = _rowset_writer->build_tmp(); Review Comment: use `_cur_rowset` is ok ? ########## be/src/olap/delta_writer.cpp: ########## @@ -380,6 +382,23 @@ Status DeltaWriter::close_wait(const PSlaveTabletNodes& slave_tablet_nodes, _request_slave_tablet_pull_rowset(node_info); } } + // do calc delete bitmap in segments here + // generate delete bitmap, build a tmp rowset and load recent segment + if (!_tablet->enable_unique_key_merge_on_write()) { + return Status::OK(); + } + auto rowset = _rowset_writer->build_tmp(); + auto beta_rowset = reinterpret_cast<BetaRowset*>(rowset.get()); + std::vector<segment_v2::SegmentSharedPtr> segments; + RETURN_IF_ERROR(beta_rowset->load_segments(&segments)); + std::shared_lock meta_rlock(_tablet->get_header_lock()); + // tablet is under alter process. The delete bitmap will be calculated after conversion. + if (_tablet->tablet_state() == TABLET_NOTREADY && + SchemaChangeHandler::tablet_in_converting(_tablet->tablet_id())) { + return Status::OK(); + } + RETURN_IF_ERROR(_tablet->calc_delete_bitmap(beta_rowset->rowset_id(), segments, nullptr, Review Comment: This section of code should be placed before line 364, because `set_txn_related_delete_bitmap` was called there. -- 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