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

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


The following commit(s) were added to refs/heads/master by this push:
     new ac8599fedb [Fix](single replica load) fix indices_size key not found 
core (#20047)
ac8599fedb is described below

commit ac8599fedb16acb49f7517fe0477b0e9a4d502ff
Author: airborne12 <airborn...@gmail.com>
AuthorDate: Sat May 27 13:28:07 2023 +0800

    [Fix](single replica load) fix indices_size key not found core (#20047)
---
 be/src/service/internal_service.cpp | 60 ++++++++++++++++++++-----------------
 1 file changed, 33 insertions(+), 27 deletions(-)

diff --git a/be/src/service/internal_service.cpp 
b/be/src/service/internal_service.cpp
index 1bd05dbe64..4470a65012 100644
--- a/be/src/service/internal_service.cpp
+++ b/be/src/service/internal_service.cpp
@@ -1311,34 +1311,40 @@ void 
PInternalServiceImpl::request_slave_tablet_pull_rowset(
             VLOG_CRITICAL << "succeed to download file for slave replica. 
url=" << remote_file_url
                           << ", local_path=" << local_file_path
                           << ", txn_id=" << rowset_meta->txn_id();
-            PTabletWriteSlaveRequest_IndexSizeMap segment_indices_size =
-                    indices_size.at(segment.first);
-            for (auto index_size : segment_indices_size.index_sizes()) {
-                auto index_id = index_size.indexid();
-                auto size = index_size.size();
-                std::string remote_inverted_index_file =
-                        
InvertedIndexDescriptor::get_index_file_name(remote_file_path, index_id);
-                std::string remote_inverted_index_file_url = construct_url(
-                        get_host_port(host, http_port), token, 
remote_inverted_index_file);
-
-                std::string local_inverted_index_file =
-                        
InvertedIndexDescriptor::get_index_file_name(local_file_path, index_id);
-                st = download_file_action(remote_inverted_index_file_url, 
local_inverted_index_file,
-                                          estimate_timeout, size);
-                if (!st.ok()) {
-                    LOG(WARNING) << "failed to pull rowset for slave replica. 
failed to download "
-                                    "file. url="
-                                 << remote_inverted_index_file_url
-                                 << ", local_path=" << 
local_inverted_index_file
-                                 << ", txn_id=" << rowset_meta->txn_id();
-                    _response_pull_slave_rowset(host, brpc_port, 
rowset_meta->txn_id(),
-                                                rowset_meta->tablet_id(), 
node_id, false);
-                    return;
+            if (indices_size.find(segment.first) != indices_size.end()) {
+                PTabletWriteSlaveRequest_IndexSizeMap segment_indices_size =
+                        indices_size.at(segment.first);
+
+                for (auto index_size : segment_indices_size.index_sizes()) {
+                    auto index_id = index_size.indexid();
+                    auto size = index_size.size();
+                    std::string remote_inverted_index_file =
+                            
InvertedIndexDescriptor::get_index_file_name(remote_file_path,
+                                                                         
index_id);
+                    std::string remote_inverted_index_file_url = construct_url(
+                            get_host_port(host, http_port), token, 
remote_inverted_index_file);
+
+                    std::string local_inverted_index_file =
+                            
InvertedIndexDescriptor::get_index_file_name(local_file_path, index_id);
+                    st = download_file_action(remote_inverted_index_file_url,
+                                              local_inverted_index_file, 
estimate_timeout, size);
+                    if (!st.ok()) {
+                        LOG(WARNING) << "failed to pull rowset for slave 
replica. failed to "
+                                        "download "
+                                        "file. url="
+                                     << remote_inverted_index_file_url
+                                     << ", local_path=" << 
local_inverted_index_file
+                                     << ", txn_id=" << rowset_meta->txn_id();
+                        _response_pull_slave_rowset(host, brpc_port, 
rowset_meta->txn_id(),
+                                                    rowset_meta->tablet_id(), 
node_id, false);
+                        return;
+                    }
+                    VLOG_CRITICAL
+                            << "succeed to download inverted index file for 
slave replica. url="
+                            << remote_inverted_index_file_url
+                            << ", local_path=" << local_inverted_index_file
+                            << ", txn_id=" << rowset_meta->txn_id();
                 }
-                VLOG_CRITICAL << "succeed to download inverted index file for 
slave replica. url="
-                              << remote_inverted_index_file_url
-                              << ", local_path=" << local_inverted_index_file
-                              << ", txn_id=" << rowset_meta->txn_id();
             }
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to