Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Aug 2, 2023
1 parent 216c73b commit 5d9594f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions be/src/olap/tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3229,6 +3229,11 @@ Status Tablet::update_delete_bitmap_without_lock(const RowsetSharedPtr& rowset)
<< ", rowset_ids: " << cur_rowset_ids.size() << ", cur max_version: " << cur_version
<< ", transaction_id: " << -1 << ", cost: " << watch.get_elapse_time_us()
<< "(us), total rows: " << total_rows;

// check if all the rowset has ROWSET_SENTINEL_MARK
RETURN_IF_ERROR(check_delete_bitmap_correctness(delete_bitmap, cur_version - 1));
remove_sentinel_mark_from_delete_bitmap(delete_bitmap);

for (auto iter = delete_bitmap->delete_bitmap.begin();
iter != delete_bitmap->delete_bitmap.end(); ++iter) {
_tablet_meta->delete_bitmap().merge(
Expand Down Expand Up @@ -3665,7 +3670,7 @@ void Tablet::remove_sentinel_mark_from_delete_bitmap(DeleteBitmapPtr delete_bitm
}
}

Status Tablet::check_delete_bitmap_correctness(DeleteBitmapPtr delete_bitmap, int64_t max_version) {
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) {
Expand All @@ -3686,9 +3691,8 @@ Status Tablet::check_delete_bitmap_correctness(DeleteBitmapPtr delete_bitmap, in
if (!value) {
LOG(WARNING) << "check delete bitmap correctness failed, can't find sentinel mark in "
"rowset with RowsetId:"
<< rowsetid << "version:" << get_rowset(rowsetid)->version().to_string()
<< "max_version:" << max_version;
DCHECK(false);
<< rowsetid << "max_version:" << max_version;
DCHECK(false) << "check delete bitmap correctness failed!";
return Status::OK();
}
}
Expand Down
3 changes: 2 additions & 1 deletion be/src/olap/tablet.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ class Tablet : public BaseTablet {
void add_sentinel_mark_to_delete_bitmap(DeleteBitmapPtr delete_bitmap,
const RowsetIdUnorderedSet& rowsetids);
void remove_sentinel_mark_from_delete_bitmap(DeleteBitmapPtr delete_bitmap);
Status check_delete_bitmap_correctness(DeleteBitmapPtr delete_bitmap, int64_t max_version);
Status check_delete_bitmap_correctness(DeleteBitmapPtr delete_bitmap,
int64_t max_version) const;

private:
Status _init_once_action();
Expand Down

0 comments on commit 5d9594f

Please sign in to comment.