From 468860c74952859c4b7838ce2385ac8298514ca7 Mon Sep 17 00:00:00 2001 From: abmdocrt Date: Tue, 22 Apr 2025 15:28:34 +0800 Subject: [PATCH] [Fix](compaction) Only print delete compaction log when there is a delete rowset (#49953) --- be/src/olap/cumulative_compaction.cpp | 7 +++++++ be/src/olap/tablet.cpp | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/be/src/olap/cumulative_compaction.cpp b/be/src/olap/cumulative_compaction.cpp index fe9e5204f4cefa..bc71fdafbf6b19 100644 --- a/be/src/olap/cumulative_compaction.cpp +++ b/be/src/olap/cumulative_compaction.cpp @@ -187,6 +187,13 @@ Status CumulativeCompaction::pick_rowsets_to_compact() { // plus 1 to skip the delete version. // NOTICE: after that, the cumulative point may be larger than max version of this tablet, but it doesn't matter. tablet()->set_cumulative_layer_point(_last_delete_version.first + 1); + LOG_INFO( + "cumulative compaction meet delete rowset, increase cumu point without " + "other " + "operation.") + .tag("tablet id:", tablet()->tablet_id()) + .tag("after cumulative compaction, cumu point:", + tablet()->cumulative_layer_point()); return Status::Error( "_last_delete_version.first not equal to -1"); } diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index a1011661fc0740..5cce7bb652b4ee 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -1722,12 +1722,6 @@ Status Tablet::prepare_compaction_and_calculate_permits( // return OK if OLAP_ERR_CUMULATIVE_NO_SUITABLE_VERSION, so that we don't need to // print too much useless logs. // And because we set permits to 0, so even if we return OK here, nothing will be done. - LOG_INFO( - "cumulative compaction meet delete rowset, increase cumu point without other " - "operation.") - .tag("tablet id:", tablet->tablet_id()) - .tag("after cumulative compaction, cumu point:", - tablet->cumulative_layer_point()); return Status::OK(); } } else if (compaction_type == CompactionType::BASE_COMPACTION) {