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 a4406ff586b [cherry-pick](branch-3.0) Pick "[Fix](status) Fix wrong 
status check in data size check (#43545)" (#44085)
a4406ff586b is described below

commit a4406ff586b9927b185af331edef0e422a68ef22
Author: abmdocrt <[email protected]>
AuthorDate: Sun Nov 17 21:09:19 2024 +0800

    [cherry-pick](branch-3.0) Pick "[Fix](status) Fix wrong status check in 
data size check (#43545)" (#44085)
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Pick #43545
---
 be/src/cloud/cloud_meta_mgr.cpp |  6 +++---
 be/src/common/status.h          |  1 -
 be/src/olap/schema_change.cpp   |  2 +-
 be/src/olap/tablet.cpp          | 20 ++++++++++++++------
 be/src/olap/tablet_manager.cpp  |  3 +--
 5 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/be/src/cloud/cloud_meta_mgr.cpp b/be/src/cloud/cloud_meta_mgr.cpp
index 1ce2326c21f..b2de0df99c2 100644
--- a/be/src/cloud/cloud_meta_mgr.cpp
+++ b/be/src/cloud/cloud_meta_mgr.cpp
@@ -1203,7 +1203,7 @@ int64_t CloudMetaMgr::get_segment_file_size(const 
RowsetMeta& rs_meta) {
         auto st = fs->file_size(segment_path, &segment_file_size);
         if (!st.ok()) {
             segment_file_size = 0;
-            if (st.is<FILE_NOT_EXIST>()) {
+            if (st.is<NOT_FOUND>()) {
                 LOG(INFO) << "cloud table size correctness check get segment 
size 0 because "
                              "file not exist! msg:"
                           << st.msg() << ", segment path:" << segment_path;
@@ -1239,7 +1239,7 @@ int64_t CloudMetaMgr::get_inverted_index_file_szie(const 
RowsetMeta& rs_meta) {
                 auto st = fs->file_size(inverted_index_file_path, &file_size);
                 if (!st.ok()) {
                     file_size = 0;
-                    if (st.is<FILE_NOT_EXIST>()) {
+                    if (st.is<NOT_FOUND>()) {
                         LOG(INFO) << "cloud table size correctness check get 
inverted index v1 "
                                      "0 because file not exist! msg:"
                                   << st.msg()
@@ -1265,7 +1265,7 @@ int64_t CloudMetaMgr::get_inverted_index_file_szie(const 
RowsetMeta& rs_meta) {
             auto st = fs->file_size(inverted_index_file_path, &file_size);
             if (!st.ok()) {
                 file_size = 0;
-                if (st.is<FILE_NOT_EXIST>()) {
+                if (st.is<NOT_FOUND>()) {
                     LOG(INFO) << "cloud table size correctness check get 
inverted index v2 "
                                  "0 because file not exist! msg:"
                               << st.msg() << ", inverted index path:" << 
inverted_index_file_path;
diff --git a/be/src/common/status.h b/be/src/common/status.h
index ec604ab866a..de029d87ec9 100644
--- a/be/src/common/status.h
+++ b/be/src/common/status.h
@@ -120,7 +120,6 @@ namespace ErrorCode {
     E(NEED_SEND_AGAIN, -241, false);                         \
     E(OS_ERROR, -242, true);                                 \
     E(DIR_NOT_EXIST, -243, true);                            \
-    E(FILE_NOT_EXIST, -244, true);                           \
     E(CREATE_FILE_ERROR, -245, true);                        \
     E(STL_ERROR, -246, true);                                \
     E(MUTEX_ERROR, -247, true);                              \
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index 1c06f3a405a..46191443506 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -1431,7 +1431,7 @@ Status SchemaChangeJob::_validate_alter_result(const 
TAlterTabletReqV2& request)
     for (auto& pair : version_rowsets) {
         RowsetSharedPtr rowset = pair.second;
         if (!rowset->check_file_exist()) {
-            return Status::Error<FILE_NOT_EXIST>(
+            return Status::Error<NOT_FOUND>(
                     "SchemaChangeJob::_validate_alter_result meet invalid 
rowset");
         }
     }
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index f97f153a860..dbec50c2354 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -2794,12 +2794,20 @@ int64_t Tablet::get_inverted_index_file_szie(const 
RowsetMetaSharedPtr& rs_meta)
             auto st = fs->file_size(inverted_index_file_path, &file_size);
             if (!st.ok()) {
                 file_size = 0;
-                LOG(WARNING) << " tablet id: " << get_tablet_info().tablet_id
-                             << ", rowset id:" << rs_meta->rowset_id()
-                             << ", table size correctness check get inverted 
index v2 "
-                                "size failed! msg:"
-                             << st.to_string()
-                             << ", inverted index path:" << 
inverted_index_file_path;
+                if (st.is<NOT_FOUND>()) {
+                    LOG(INFO) << " tablet id: " << get_tablet_info().tablet_id
+                              << ", rowset id:" << rs_meta->rowset_id()
+                              << ", table size correctness check get inverted 
index v2 failed "
+                                 "because file not exist:"
+                              << inverted_index_file_path;
+                } else {
+                    LOG(WARNING) << " tablet id: " << 
get_tablet_info().tablet_id
+                                 << ", rowset id:" << rs_meta->rowset_id()
+                                 << ", table size correctness check get 
inverted index v2 "
+                                    "size failed! msg:"
+                                 << st.to_string()
+                                 << ", inverted index path:" << 
inverted_index_file_path;
+                }
             }
             total_inverted_index_size += file_size;
         }
diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp
index 8c1939152af..5d068da745e 100644
--- a/be/src/olap/tablet_manager.cpp
+++ b/be/src/olap/tablet_manager.cpp
@@ -948,8 +948,7 @@ Status TabletManager::load_tablet_from_dir(DataDir* store, 
TTabletId tablet_id,
     bool exists = false;
     RETURN_IF_ERROR(io::global_local_filesystem()->exists(header_path, 
&exists));
     if (!exists) {
-        return Status::Error<FILE_NOT_EXIST>("fail to find header file. 
[header_path={}]",
-                                             header_path);
+        return Status::Error<NOT_FOUND>("fail to find header file. 
[header_path={}]", header_path);
     }
 
     TabletMetaSharedPtr tablet_meta(new TabletMeta());


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

Reply via email to