github-actions[bot] commented on code in PR #43011:
URL: https://github.com/apache/doris/pull/43011#discussion_r1824162787
##########
be/src/olap/base_tablet.cpp:
##########
@@ -1505,7 +1573,210 @@ Status BaseTablet::update_delete_bitmap(const
BaseTabletSPtr& self, TabletTxnInf
[](size_t sum, const segment_v2::SegmentSharedPtr& s) { return sum
+= s->num_rows(); });
auto t5 = watch.get_elapse_time_us();
RETURN_IF_ERROR(self->save_delete_bitmap(txn_info, txn_id, delete_bitmap,
- transient_rs_writer.get(),
cur_rowset_ids));
+ transient_rs_writer.get(),
cur_rowset_ids,
+ base_txn_id /* lock_id */));
+ LOG(INFO) << "[Publish] construct delete bitmap tablet: " <<
self->tablet_id()
+ << ", rowset_ids to add: " << rowset_ids_to_add.size()
+ << ", rowset_ids to del: " << rowset_ids_to_del.size()
+ << ", cur version: " << cur_version << ", transaction_id: " <<
txn_id << ","
+ << ss.str() << " , total rows: " << total_rows
+ << ", update delete_bitmap cost: " << watch.get_elapse_time_us()
- t5 << "(us)";
+ return Status::OK();
+}
+
+Status BaseTablet::update_delete_bitmap(const BaseTabletSPtr& self,
TabletTxnInfo* txn_info,
+ int64_t txn_id, int64_t
txn_expiration) {
+ return update_delete_bitmap(self, txn_info, txn_id, txn_expiration,
nullptr, -1,
+ txn_info->rowset->start_version(), nullptr);
+}
+
+Status BaseTablet::txn_load_update_delete_bitmap(
+ const BaseTabletSPtr& self, const std::vector<RowsetSharedPtr>&
visible_rowsets,
+ const std::vector<RowsetSharedPtr>& all_non_visible_rowsets, int64_t
visible_version,
+ const std::vector<int64_t>& sub_txn_ids,
+ std::vector<std::shared_ptr<TabletTxnInfo>>& tablet_txn_infos,
+ DeleteBitmapPtr tablet_delete_bitmap) {
+ // calculate delete bitmap of sub txn rowsets
+ for (auto i = 0; i < tablet_txn_infos.size(); ++i) {
+ auto& tablet_txn_info = tablet_txn_infos[i];
+ auto sub_txn_id = sub_txn_ids[i];
+ if (tablet_txn_info->rowset->rowset_meta()->has_delete_predicate()) {
+ continue;
+ }
+ std::vector<RowsetSharedPtr> non_visible_rowsets;
+ for (auto j = 0; j < i; ++j) {
+ auto rowset = all_non_visible_rowsets[j];
+ non_visible_rowsets.push_back(rowset);
+ }
+ tablet_txn_info->delete_bitmap->delete_bitmap.clear();
+ tablet_txn_info->rowset_ids.clear();
+ // TODO the version is set when capture?
+ int64_t tmp_version = visible_version + i + 1;
+ RETURN_IF_ERROR(self->txn_load_update_delete_bitmap(
+ self, tablet_txn_info.get(), sub_txn_id, -1, visible_rowsets,
non_visible_rowsets,
+ tablet_delete_bitmap));
+ // merge delete bitmap of sub txn rowsets
+ auto& dm = tablet_txn_info->delete_bitmap->delete_bitmap;
+ for (auto it = dm.begin(); it != dm.end(); ++it) {
+ if (std::get<1>(it->first) != DeleteBitmap::INVALID_SEGMENT_ID) {
+ tablet_delete_bitmap->merge(
+ {std::get<0>(it->first), std::get<1>(it->first),
tmp_version}, it->second);
+ }
+ }
+ }
+ return Status::OK();
+}
+
+Status BaseTablet::txn_load_update_delete_bitmap(
Review Comment:
warning: function 'txn_load_update_delete_bitmap' exceeds recommended
size/complexity thresholds [readability-function-size]
```cpp
Status BaseTablet::txn_load_update_delete_bitmap(
^
```
<details>
<summary>Additional context</summary>
**be/src/olap/base_tablet.cpp:1629:** 153 lines including whitespace and
comments (threshold 80)
```cpp
Status BaseTablet::txn_load_update_delete_bitmap(
^
```
</details>
--
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]