From e8ebc02e0b656dde156d938bb84ca604e51357ff Mon Sep 17 00:00:00 2001 From: zhannngchen <48427519+zhannngchen@users.noreply.github.com> Date: Mon, 15 Apr 2024 23:03:24 +0800 Subject: [PATCH] [enhancement](merge-on-write) compaction should not check correctness if tablet is not ready (#33435) (#33658) --- be/src/olap/compaction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index 8928d47160..367702b4f7 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -437,6 +437,7 @@ Status Compaction::do_compaction_impl(int64_t permits) { if (!allow_delete_in_cumu_compaction()) { missed_rows_size = missed_rows.size(); if (compaction_type() == ReaderType::READER_CUMULATIVE_COMPACTION && + _tablet->tablet_state() == TABLET_RUNNING && stats.merged_rows != missed_rows_size) { std::string err_msg = fmt::format( "cumulative compaction: the merged rows({}) is not equal to missed " @@ -911,7 +912,8 @@ Status Compaction::modify_rowsets(const Merger::Statistics* stats) { &output_rowset_delete_bitmap); if (!allow_delete_in_cumu_compaction()) { missed_rows_size = missed_rows.size(); - if (compaction_type() == ReaderType::READER_CUMULATIVE_COMPACTION && stats != nullptr && + if (compaction_type() == ReaderType::READER_CUMULATIVE_COMPACTION && + _tablet->tablet_state() == TABLET_RUNNING && stats != nullptr && stats->merged_rows != missed_rows_size) { std::string err_msg = fmt::format( "cumulative compaction: the merged rows({}) is not equal to missed "