diff --git a/be/src/cloud/cloud_tablet.cpp b/be/src/cloud/cloud_tablet.cpp index 6c6cadcd082cc6..0da1bbc8b6eb44 100644 --- a/be/src/cloud/cloud_tablet.cpp +++ b/be/src/cloud/cloud_tablet.cpp @@ -984,7 +984,9 @@ Status CloudTablet::calc_delete_bitmap_for_compaction( if ((config::enable_missing_rows_correctness_check || config::enable_mow_compaction_correctness_check_core) && !allow_delete_in_cumu_compaction && - compaction_type == ReaderType::READER_CUMULATIVE_COMPACTION) { + (compaction_type == ReaderType::READER_CUMULATIVE_COMPACTION || + !config::enable_prune_delete_sign_when_base_compaction)) { + // also check duplicate key for base compaction when config::enable_prune_delete_sign_when_base_compaction==false missed_rows = std::make_unique(); LOG(INFO) << "RowLocation Set inited succ for tablet:" << tablet_id(); } @@ -1005,7 +1007,8 @@ Status CloudTablet::calc_delete_bitmap_for_compaction( if (missed_rows) { missed_rows_size = missed_rows->size(); if (!allow_delete_in_cumu_compaction) { - if (compaction_type == ReaderType::READER_CUMULATIVE_COMPACTION && + if ((compaction_type == ReaderType::READER_CUMULATIVE_COMPACTION || + !config::enable_prune_delete_sign_when_base_compaction) && tablet_state() == TABLET_RUNNING) { if (merged_rows >= 0 && merged_rows != missed_rows_size) { std::string err_msg = fmt::format( diff --git a/be/src/olap/tablet_reader.cpp b/be/src/olap/tablet_reader.cpp index a0c3a9c5eda95b..a453634ca8381f 100644 --- a/be/src/olap/tablet_reader.cpp +++ b/be/src/olap/tablet_reader.cpp @@ -635,7 +635,8 @@ Status TabletReader::_init_delete_condition(const ReaderParams& read_params) { // Delete sign could not be applied when delete on cumu compaction is enabled, bucause it is meant for delete with predicates. // If delete design is applied on cumu compaction, it will lose effect when doing base compaction. // `_delete_sign_available` indicates the condition where we could apply delete signs to data. - _delete_sign_available = ((read_params.reader_type == ReaderType::READER_BASE_COMPACTION && + _delete_sign_available = (((read_params.reader_type == ReaderType::READER_BASE_COMPACTION || + read_params.reader_type == ReaderType::READER_FULL_COMPACTION) && config::enable_prune_delete_sign_when_base_compaction) || read_params.reader_type == ReaderType::READER_COLD_DATA_COMPACTION || read_params.reader_type == ReaderType::READER_CHECKSUM); diff --git a/regression-test/data/compaction/test_full_compaction.out b/regression-test/data/compaction/test_full_compaction.out index b25fdad93145cc..118191b6cc8464 100644 --- a/regression-test/data/compaction/test_full_compaction.out +++ b/regression-test/data/compaction/test_full_compaction.out @@ -39,5 +39,4 @@ -- !select_final -- 1 100 2 200 -3 0 diff --git a/regression-test/data/compaction/test_full_compaction_by_table_id.out b/regression-test/data/compaction/test_full_compaction_by_table_id.out index b25fdad93145cc..118191b6cc8464 100644 --- a/regression-test/data/compaction/test_full_compaction_by_table_id.out +++ b/regression-test/data/compaction/test_full_compaction_by_table_id.out @@ -39,5 +39,4 @@ -- !select_final -- 1 100 2 200 -3 0