Skip to content

Commit daf4f0a

Browse files
authored
[fix](cloud-mow) Add enable config for procesing old version delete bitmap when doing cu compaction (#43615)
pr #40204 support deleting old version delete bitmap when doing cu compaction, it a new function and better to add a config to enable it or not. pick pr:#42471
1 parent 3ba7cc5 commit daf4f0a

7 files changed

+13
-4
lines changed

be/src/cloud/cloud_cumulative_compaction.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ Status CloudCumulativeCompaction::modify_rowsets() {
360360
stats.num_rows(), stats.data_size());
361361
}
362362
}
363-
if (_tablet->keys_type() == KeysType::UNIQUE_KEYS &&
363+
if (config::enable_delete_bitmap_merge_on_compaction &&
364+
_tablet->keys_type() == KeysType::UNIQUE_KEYS &&
364365
_tablet->enable_unique_key_merge_on_write() && _input_rowsets.size() != 1) {
365366
RETURN_IF_ERROR(process_old_version_delete_bitmap());
366367
}

be/src/cloud/cloud_delete_bitmap_action.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ Status CloudDeleteBitmapAction::_handle_show_delete_bitmap_count(HttpRequest* re
9595
auto count = tablet->tablet_meta()->delete_bitmap().get_delete_bitmap_count();
9696
auto cardinality = tablet->tablet_meta()->delete_bitmap().cardinality();
9797
auto size = tablet->tablet_meta()->delete_bitmap().get_size();
98+
LOG(INFO) << "show_delete_bitmap_count,tablet_id=" << tablet_id << ",count=" << count
99+
<< ",cardinality=" << cardinality << ",size=" << size;
98100

99101
rapidjson::Document root;
100102
root.SetObject();

be/src/cloud/cloud_meta_mgr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ Status CloudMetaMgr::update_delete_bitmap(const CloudTablet& tablet, int64_t loc
10741074
Status CloudMetaMgr::cloud_update_delete_bitmap_without_lock(const CloudTablet& tablet,
10751075
DeleteBitmap* delete_bitmap) {
10761076
LOG(INFO) << "cloud_update_delete_bitmap_without_lock , tablet_id: " << tablet.tablet_id()
1077-
<< ",delete_bitmap size:" << delete_bitmap->delete_bitmap.size();
1077+
<< ",delete_bitmap size:" << delete_bitmap->get_delete_bitmap_count();
10781078
UpdateDeleteBitmapRequest req;
10791079
UpdateDeleteBitmapResponse res;
10801080
req.set_cloud_unique_id(config::cloud_unique_id);

be/src/common/config.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,8 @@ DEFINE_mBool(enable_pipeline_task_leakage_detect, "false");
13791379

13801380
DEFINE_Int32(query_cache_size, "512");
13811381

1382+
DEFINE_mBool(enable_delete_bitmap_merge_on_compaction, "false");
1383+
13821384
// Enable validation to check the correctness of table size.
13831385
DEFINE_Bool(enable_table_size_correctness_check, "false");
13841386

be/src/common/config.h

+2
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,8 @@ DECLARE_mBool(enable_pipeline_task_leakage_detect);
14591459
// MB
14601460
DECLARE_Int32(query_cache_size);
14611461

1462+
DECLARE_mBool(enable_delete_bitmap_merge_on_compaction);
1463+
14621464
// Enable validation to check the correctness of table size.
14631465
DECLARE_Bool(enable_table_size_correctness_check);
14641466

be/src/olap/rowset/beta_rowset_writer.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ Status BaseBetaRowsetWriter::_generate_delete_bitmap(int32_t segment_id) {
336336
LOG(INFO) << "[Memtable Flush] construct delete bitmap tablet: " << _context.tablet->tablet_id()
337337
<< ", rowset_ids: " << _context.mow_context->rowset_ids.size()
338338
<< ", cur max_version: " << _context.mow_context->max_version
339-
<< ", transaction_id: " << _context.mow_context->txn_id << ", delete_bitmap_count: "
340-
<< _context.tablet->tablet_meta()->delete_bitmap().get_delete_bitmap_count()
339+
<< ", transaction_id: " << _context.mow_context->txn_id
341340
<< ", cost: " << watch.get_elapse_time_us() << "(us), total rows: " << total_rows;
342341
return Status::OK();
343342
}

be/src/olap/tablet_meta.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,9 @@ void DeleteBitmap::add_to_remove_queue(
11881188
}
11891189

11901190
void DeleteBitmap::remove_stale_delete_bitmap_from_queue(const std::vector<std::string>& vector) {
1191+
if (!config::enable_delete_bitmap_merge_on_compaction) {
1192+
return;
1193+
}
11911194
std::shared_lock l(stale_delete_bitmap_lock);
11921195
//<rowset_id, start_version, end_version>
11931196
std::vector<std::tuple<std::string, uint64_t, uint64_t>> to_delete;

0 commit comments

Comments
 (0)