dataroaring commented on code in PR #53908:
URL: https://github.com/apache/doris/pull/53908#discussion_r2286928033
##########
be/src/cloud/cloud_meta_mgr.cpp:
##########
@@ -711,6 +724,89 @@ Status
CloudMetaMgr::sync_tablet_rowsets_unlocked(CloudTablet* tablet,
.tag("new_rowsets(rowset,count,cardinality)",
fmt::format("[{}]", fmt::join(new_rowset_msgs, ",
")));
}
+ if (check_delete_bitmap_v2) {
+ int64_t new_max_version =
+ std::max(old_max_version,
resp.rowset_meta().rbegin()->end_version());
+ // rowset_id, num_segments
+ std::vector<std::pair<RowsetId, int64_t>> all_rowsets;
+ std::map<std::string, std::string> rowset_to_resource;
+ for (const auto& rs_meta : resp.rowset_meta()) {
+ RowsetId rowset_id;
+ rowset_id.init(rs_meta.rowset_id_v2());
+ all_rowsets.emplace_back(std::make_pair(rowset_id,
rs_meta.num_segments()));
+ rowset_to_resource[rs_meta.rowset_id_v2()] =
rs_meta.resource_id();
+ }
+ if (old_max_version > 0) {
+ RowsetIdUnorderedSet all_rs_ids;
+ RETURN_IF_ERROR(tablet->get_all_rs_id(old_max_version,
&all_rs_ids));
+ for (auto& rowset :
tablet->get_rowset_by_ids(&all_rs_ids)) {
+ all_rowsets.emplace_back(
+ std::make_pair(rowset->rowset_id(),
rowset->num_segments()));
+ rowset_to_resource[rowset->rowset_id().to_string()] =
+ rowset->rowset_meta()->resource_id();
+ }
+ }
+
+ auto compare_delete_bitmap = [&](DeleteBitmap* delete_bitmap,
int version) {
+ bool success = true;
+ for (auto& [rs_id, num_segments] : all_rowsets) {
+ for (int seg_id = 0; seg_id < num_segments; ++seg_id) {
+ DeleteBitmap::BitmapKey key = {rs_id, seg_id,
new_max_version};
+ auto dm1 =
tablet->tablet_meta()->delete_bitmap().get_agg(key);
+ auto dm2 =
delete_bitmap->get_agg_without_cache(key);
+ if (*dm1 != *dm2) {
+ success = false;
+ LOG(WARNING) << "failed to check delete bitmap
correctness by v"
+ << std::to_string(version)
+ << ", tablet_id=" <<
tablet->tablet_id()
+ << ", rowset_id=" <<
rs_id.to_string()
+ << ", segment_id=" << seg_id
+ << ", max_version=" <<
new_max_version
+ << ". size1=" <<
dm1->cardinality()
+ << ", size2=" <<
dm2->cardinality();
+ }
+ }
+ }
+ if (success) {
+ LOG(INFO) << "succeed to check delete bitmap
correctness by v"
+ << std::to_string(version)
+ << ", tablet_id=" << tablet->tablet_id()
+ << ", max_version=" << new_max_version;
+ }
+ };
+
+ // check v2 delete bitmap in ms
+ if (check_delete_bitmap_v2) {
+ DeleteBitmap full_delete_bitmap(tablet_id);
+ auto status = sync_tablet_delete_bitmap_v2(
Review Comment:
delete bitmap is synced already above.
--
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]