zhannngchen commented on code in PR #22282:
URL: https://github.com/apache/doris/pull/22282#discussion_r1282601647


##########
be/src/olap/tablet.cpp:
##########
@@ -3637,4 +3657,46 @@ Status Tablet::calc_delete_bitmap_between_segments(
     return Status::OK();
 }
 
+void Tablet::add_sentinel_mark_to_delete_bitmap(DeleteBitmapPtr delete_bitmap,
+                                                const RowsetIdUnorderedSet& 
rowsetids) {
+    for (const auto& rowsetid : rowsetids) {
+        delete_bitmap->add({rowsetid, DeleteBitmap::INVALID_SEGMENT_ID, 0},
+                           DeleteBitmap::ROWSET_SENTINEL_MARK);
+    }
+}
+
+void Tablet::remove_sentinel_mark_from_delete_bitmap(DeleteBitmapPtr 
delete_bitmap) {
+    for (auto& [key, bitmap] : delete_bitmap->delete_bitmap) {
+        bitmap.remove(DeleteBitmap::ROWSET_SENTINEL_MARK);
+    }
+}
+
+Status Tablet::check_delete_bitmap_correctness(DeleteBitmapPtr delete_bitmap, 
int64_t max_version) const {
+    std::map<RowsetId, bool> result;
+    RowsetIdUnorderedSet rowsets = all_rs_id(max_version);
+    for (const auto& rowsetid : rowsets) {
+        result.emplace(rowsetid, false);
+    }
+    for (const auto& [key, bitmap] : delete_bitmap->delete_bitmap) {
+        auto it = result.find(std::get<0>(key));
+        if (it == result.end()) {
+            LOG(WARNING) << "can't find rowsetid when checking delete bitmap 
correctness";

Review Comment:
   print the missing rowset_id



##########
be/src/olap/tablet.cpp:
##########
@@ -3637,4 +3657,46 @@ Status Tablet::calc_delete_bitmap_between_segments(
     return Status::OK();
 }
 
+void Tablet::add_sentinel_mark_to_delete_bitmap(DeleteBitmapPtr delete_bitmap,
+                                                const RowsetIdUnorderedSet& 
rowsetids) {
+    for (const auto& rowsetid : rowsetids) {
+        delete_bitmap->add({rowsetid, DeleteBitmap::INVALID_SEGMENT_ID, 0},
+                           DeleteBitmap::ROWSET_SENTINEL_MARK);
+    }
+}
+
+void Tablet::remove_sentinel_mark_from_delete_bitmap(DeleteBitmapPtr 
delete_bitmap) {
+    for (auto& [key, bitmap] : delete_bitmap->delete_bitmap) {
+        bitmap.remove(DeleteBitmap::ROWSET_SENTINEL_MARK);
+    }
+}
+
+Status Tablet::check_delete_bitmap_correctness(DeleteBitmapPtr delete_bitmap, 
int64_t max_version) const {
+    std::map<RowsetId, bool> result;
+    RowsetIdUnorderedSet rowsets = all_rs_id(max_version);
+    for (const auto& rowsetid : rowsets) {
+        result.emplace(rowsetid, false);
+    }
+    for (const auto& [key, bitmap] : delete_bitmap->delete_bitmap) {
+        auto it = result.find(std::get<0>(key));
+        if (it == result.end()) {
+            LOG(WARNING) << "can't find rowsetid when checking delete bitmap 
correctness";

Review Comment:
   print the missed rowset_id



-- 
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

Reply via email to