From 09a6dc3fcc1e31640d3d9c4a9eced2616322d83c Mon Sep 17 00:00:00 2001 From: Yukang-Lian Date: Wed, 12 Jul 2023 17:53:34 +0800 Subject: [PATCH] 5 --- be/src/olap/compaction.cpp | 20 +++++++++----------- be/src/olap/full_compaction.cpp | 8 ++++---- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp index bc2f845b23a2571..18fab222fcc8ac7 100644 --- a/be/src/olap/compaction.cpp +++ b/be/src/olap/compaction.cpp @@ -722,21 +722,19 @@ Status Compaction::check_version_continuity(const std::vector& Status Compaction::check_all_version(const std::vector& rowsets) { if (rowsets.empty()) { - return Status::Error(); + return Status::Error("There is no input rowset when do full compaction"); } const RowsetSharedPtr& last_rowset = rowsets.back(); const RowsetSharedPtr& first_rowset = rowsets.front(); if (last_rowset->version() != _tablet->max_version() || first_rowset->version().first != 0) { - LOG(WARNING) - << "Full compaction rowsets' versions not equal to all exist rowsets' versions. " - << "full compaction rowsets max version=" << last_rowset->start_version() << "-" - << last_rowset->end_version() - << ", current rowsets max version=" << _tablet->max_version().first << "-" - << _tablet->max_version().second - << "full compaction rowsets min version=" << first_rowset->start_version() << "-" - << first_rowset->end_version() << ", current rowsets min version=" - << "0-1"; - return Status::Error(); + return Status::Error( + "Full compaction rowsets' versions not equal to all exist rowsets' versions. " + "full compaction rowsets max version={}-{}" + ", current rowsets max version={}-{}" + "full compaction rowsets min version={}-{}, current rowsets min version=0-1", + last_rowset->start_version(), last_rowset->end_version(), + _tablet->max_version().first, _tablet->max_version().second, + first_rowset->start_version(), first_rowset->end_version()); } return Status::OK(); } diff --git a/be/src/olap/full_compaction.cpp b/be/src/olap/full_compaction.cpp index f50936c74cdaa85..e77916611879889 100644 --- a/be/src/olap/full_compaction.cpp +++ b/be/src/olap/full_compaction.cpp @@ -44,7 +44,7 @@ FullCompaction::~FullCompaction() {} Status FullCompaction::prepare_compact() { if (!_tablet->init_succeeded()) { - return Status::Error(); + return Status::Error("Full compaction init failed"); } std::unique_lock full_lock(_tablet->get_full_compaction_lock()); @@ -67,7 +67,7 @@ Status FullCompaction::execute_compact_impl() { // for compaction may change. In this case, current compaction task should not be executed. if (_tablet->get_clone_occurred()) { _tablet->set_clone_occurred(false); - return Status::Error(); + return Status::Error("get_clone_occurred failed"); } SCOPED_ATTACH_TASK(_mem_tracker); @@ -94,13 +94,13 @@ Status FullCompaction::pick_rowsets_to_compact() { RETURN_IF_ERROR(check_version_continuity(_input_rowsets)); RETURN_IF_ERROR(check_all_version(_input_rowsets)); if (_input_rowsets.size() <= 1) { - return Status::Error(); + return Status::Error("There is no suitable version"); } if (_input_rowsets.size() == 2 && _input_rowsets[0]->end_version() == 1) { // the tablet is with rowset: [0-1], [2-y] // and [0-1] has no data. in this situation, no need to do full compaction. - return Status::Error(); + return Status::Error("There is no suitable version"); } return Status::OK();