[fix](merge-on-write) add sentinel mark when do compaction (#23078)

This commit is contained in:
bobhan1
2023-08-17 20:08:01 +08:00
committed by GitHub
parent c5c984b79b
commit 29ff7b7964
4 changed files with 10 additions and 4 deletions

View File

@ -658,6 +658,12 @@ Status Compaction::modify_rowsets(const Merger::Statistics* stats) {
_tablet->calc_compaction_output_rowset_delete_bitmap(
_input_rowsets, _rowid_conversion, 0, UINT64_MAX, &missed_rows,
&location_map, *it.delete_bitmap.get(), &output_delete_bitmap);
if (config::enable_merge_on_write_correctness_check) {
RowsetIdUnorderedSet rowsetids;
rowsetids.insert(_output_rowset->rowset_id());
_tablet->add_sentinel_mark_to_delete_bitmap(&output_rowset_delete_bitmap,
rowsetids);
}
it.delete_bitmap->merge(output_delete_bitmap);
// Step3: write back updated delete bitmap and tablet info.
it.rowset_ids.insert(_output_rowset->rowset_id());

View File

@ -464,7 +464,7 @@ Status SegmentWriter::append_block_with_partial_content(const vectorized::Block*
CHECK(use_default_or_null_flag.size() == num_rows);
if (config::enable_merge_on_write_correctness_check) {
_tablet->add_sentinel_mark_to_delete_bitmap(_mow_context->delete_bitmap,
_tablet->add_sentinel_mark_to_delete_bitmap(_mow_context->delete_bitmap.get(),
_mow_context->rowset_ids);
}

View File

@ -2993,7 +2993,7 @@ Status Tablet::calc_segment_delete_bitmap(RowsetSharedPtr rowset,
<< "[add_sentinel_mark_to_delete_bitmap][end_version:" << end_version << "]"
<< "add:" << rowset->rowset_id();
}
add_sentinel_mark_to_delete_bitmap(delete_bitmap, rowsetids);
add_sentinel_mark_to_delete_bitmap(delete_bitmap.get(), rowsetids);
}
if (pos > 0) {
@ -3684,7 +3684,7 @@ Status Tablet::calc_delete_bitmap_between_segments(
return Status::OK();
}
void Tablet::add_sentinel_mark_to_delete_bitmap(DeleteBitmapPtr delete_bitmap,
void Tablet::add_sentinel_mark_to_delete_bitmap(DeleteBitmap* delete_bitmap,
const RowsetIdUnorderedSet& rowsetids) {
for (const auto& rowsetid : rowsetids) {
delete_bitmap->add({rowsetid, DeleteBitmap::INVALID_SEGMENT_ID, 0},

View File

@ -549,7 +549,7 @@ public:
int64_t binlog_max_bytes() const { return _tablet_meta->binlog_config().max_bytes(); }
void set_binlog_config(BinlogConfig binlog_config);
void add_sentinel_mark_to_delete_bitmap(DeleteBitmapPtr delete_bitmap,
void add_sentinel_mark_to_delete_bitmap(DeleteBitmap* delete_bitmap,
const RowsetIdUnorderedSet& rowsetids);
private: