From 199dbe5b57c0e81dbcf477cb0aa2e0ba59639668 Mon Sep 17 00:00:00 2001 From: Yongqiang YANG Date: Thu, 9 Nov 2023 14:40:16 +0800 Subject: [PATCH 1/2] [enhancement](230) print max version and spec version when -230 happens More information is provided. --- be/src/olap/tablet.cpp | 9 +++++++-- be/src/vec/exec/scan/new_olap_scanner.cpp | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index 746a917a80af56..11677dc869430a 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -881,9 +881,14 @@ Status Tablet::capture_consistent_versions(const Version& spec_version, // so to avoid print too many logs. if (version_path != nullptr) { LOG(WARNING) << "tablet:" << tablet_id() - << ", version already has been merged. spec_version: " << spec_version; + << ", version already has been merged. spec_version: " << spec_version + << ", max_version: " << max_version_unlocked(); } - status = Status::Error("missed_versions is empty"); + status = Status::Error("missed_versions is empty, spec_version " + "{}, max_version {}, tablet_id {}", + spec_version.second, + max_version_unlocked().second, + tablet_id()); } else { if (version_path != nullptr) { LOG(WARNING) << "status:" << status << ", tablet:" << tablet_id() diff --git a/be/src/vec/exec/scan/new_olap_scanner.cpp b/be/src/vec/exec/scan/new_olap_scanner.cpp index 7992ab1a4566bb..0726c71e45daa9 100644 --- a/be/src/vec/exec/scan/new_olap_scanner.cpp +++ b/be/src/vec/exec/scan/new_olap_scanner.cpp @@ -186,9 +186,7 @@ Status NewOlapScanner::init() { _state->skip_missing_version()); if (!st.ok()) { LOG(WARNING) << "fail to init reader.res=" << st; - return Status::InternalError( - "failed to initialize storage reader. tablet_id={} : {}", - tablet->tablet_id(), st.to_string()); + return st; } } if (!_state->skip_delete_predicate()) { From 62be1864248bdd754b0be53d8ddb94feefe97bf9 Mon Sep 17 00:00:00 2001 From: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:47:22 +0800 Subject: [PATCH 2/2] Update tablet.cpp --- be/src/olap/tablet.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index 11677dc869430a..086baa642c8075 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -884,11 +884,10 @@ Status Tablet::capture_consistent_versions(const Version& spec_version, << ", version already has been merged. spec_version: " << spec_version << ", max_version: " << max_version_unlocked(); } - status = Status::Error("missed_versions is empty, spec_version " - "{}, max_version {}, tablet_id {}", - spec_version.second, - max_version_unlocked().second, - tablet_id()); + status = Status::Error( + "missed_versions is empty, spec_version " + "{}, max_version {}, tablet_id {}", + spec_version.second, max_version_unlocked().second, tablet_id()); } else { if (version_path != nullptr) { LOG(WARNING) << "status:" << status << ", tablet:" << tablet_id()