This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 6a9f627a00e [branch-3.0] [fix](cloud) Check internal_get_tablet_stats 
error code #55065 (#55189)
6a9f627a00e is described below

commit 6a9f627a00ea0ede40d2d8bf03193b1ca5f55036
Author: Uniqueyou <[email protected]>
AuthorDate: Sun Aug 24 15:27:05 2025 +0800

    [branch-3.0] [fix](cloud) Check internal_get_tablet_stats error code #55065 
(#55189)
    
    pick: https://github.com/apache/doris/pull/55065
---
 cloud/src/meta-service/meta_service_job.cpp          | 18 ++++++++++++++++++
 cloud/src/meta-service/meta_service_tablet_stats.cpp |  4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/cloud/src/meta-service/meta_service_job.cpp 
b/cloud/src/meta-service/meta_service_job.cpp
index 6b60a0dd81c..7b1f1346203 100644
--- a/cloud/src/meta-service/meta_service_job.cpp
+++ b/cloud/src/meta-service/meta_service_job.cpp
@@ -712,6 +712,15 @@ void process_compaction_job(MetaServiceCode& code, 
std::string& msg, std::string
     //  with `config::split_tablet_stats = true` can meet the condition.
     internal_get_tablet_stats(code, msg, txn.get(), instance_id, 
request->job().idx(), *stats,
                               detached_stats, 
config::snapshot_get_tablet_stats);
+    if (code != MetaServiceCode::OK) {
+        LOG_WARNING("failed to get tablet stats")
+                .tag("instance_id", instance_id)
+                .tag("tablet_id", tablet_id)
+                .tag("code", code)
+                .tag("msg", msg);
+        return;
+    }
+
     if (compaction.type() == TabletCompactionJobPB::EMPTY_CUMULATIVE) {
         
stats->set_cumulative_compaction_cnt(stats->cumulative_compaction_cnt() + 1);
         stats->set_cumulative_point(compaction.output_cumulative_point());
@@ -1303,6 +1312,15 @@ void process_schema_change_job(MetaServiceCode& code, 
std::string& msg, std::str
     //  with `config::split_tablet_stats = true` can meet the condition.
     internal_get_tablet_stats(code, msg, txn.get(), instance_id, 
new_tablet_idx, *stats,
                               detached_stats, 
config::snapshot_get_tablet_stats);
+    if (code != MetaServiceCode::OK) {
+        LOG_WARNING("failed to get tablet stats")
+                .tag("instance_id", instance_id)
+                .tag("tablet_id", tablet_id)
+                .tag("code", code)
+                .tag("msg", msg);
+        return;
+    }
+
     // clang-format off
     // ATTN: cumu point in job is from base tablet which may be fetched long 
time ago
     //       since the new tablet may have done cumu compactions with 
alter_version as initial cumu point
diff --git a/cloud/src/meta-service/meta_service_tablet_stats.cpp 
b/cloud/src/meta-service/meta_service_tablet_stats.cpp
index c8bb315f60e..07f86f20d1b 100644
--- a/cloud/src/meta-service/meta_service_tablet_stats.cpp
+++ b/cloud/src/meta-service/meta_service_tablet_stats.cpp
@@ -173,7 +173,9 @@ void internal_get_tablet_stats(MetaServiceCode& code, 
std::string& msg, Transact
                                TabletStatsPB& stats, bool snapshot) {
     TabletStats detached_stats;
     internal_get_tablet_stats(code, msg, txn, instance_id, idx, stats, 
detached_stats, snapshot);
-    merge_tablet_stats(stats, detached_stats);
+    if (code == MetaServiceCode::OK) {
+        merge_tablet_stats(stats, detached_stats);
+    }
 }
 
 MetaServiceResponseStatus parse_fix_tablet_stats_param(


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to