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

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


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

commit a4ac0ba3c1d5764d04134692aa8cce01531352d0
Author: Uniqueyou <[email protected]>
AuthorDate: Mon Aug 25 01:31:38 2025 +0800

    branch-3.1: [fix](cloud) Check internal_get_tablet_stats error code #55065 
(#55188)
    
    pick: #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 ac63258e6c8..e974513c244 100644
--- a/cloud/src/meta-service/meta_service_job.cpp
+++ b/cloud/src/meta-service/meta_service_job.cpp
@@ -789,6 +789,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());
@@ -1383,6 +1392,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