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

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


The following commit(s) were added to refs/heads/opt_memtable_speed by this 
push:
     new b12a39c66b [fix](move-memtable) fix close load core (#23212)
b12a39c66b is described below

commit b12a39c66ba5850f85f5b1e8f06947947d76361f
Author: HHoflittlefish777 <77738092+hhoflittlefish...@users.noreply.github.com>
AuthorDate: Sun Aug 20 02:19:32 2023 +0800

    [fix](move-memtable) fix close load core (#23212)
---
 be/src/vec/sink/vtablet_sink_v2.cpp | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/be/src/vec/sink/vtablet_sink_v2.cpp 
b/be/src/vec/sink/vtablet_sink_v2.cpp
index 567b259af3..a61d62749b 100644
--- a/be/src/vec/sink/vtablet_sink_v2.cpp
+++ b/be/src/vec/sink/vtablet_sink_v2.cpp
@@ -598,14 +598,17 @@ Status VOlapTableSinkV2::_close_load(brpc::StreamId 
stream) {
     header.set_sender_id(_sender_id);
     header.set_allocated_load_id(&_load_id);
     header.set_opcode(doris::PStreamHeader::CLOSE_LOAD);
+    auto node = _node_id_for_stream.get()->at(stream);
+    auto partition_tablet_mapping = _node_partition_tablet_mapping.at(node);
     for (auto partition_id : _tablet_finder->partition_ids()) {
-        auto node = _node_id_for_stream.get()->at(stream);
-        auto partition_tablet_mapping = 
_node_partition_tablet_mapping.at(node);
-        auto tablet_ids = partition_tablet_mapping.at(partition_id);
-        for (auto& tablet_id : tablet_ids) {
-            NeedCommitTabletInfo* need_commit_tablet_info = 
header.add_need_commit_tablet_info();;
-            need_commit_tablet_info->set_tablet_id(tablet_id);
-            need_commit_tablet_info->set_partition_id(partition_id);
+        auto tablet_ids_it = partition_tablet_mapping.find(partition_id);
+        if (tablet_ids_it != partition_tablet_mapping.end()) {
+            for (auto& tablet_id : tablet_ids_it->second) {
+                NeedCommitTabletInfo* need_commit_tablet_info =
+                        header.add_need_commit_tablet_info();
+                need_commit_tablet_info->set_tablet_id(tablet_id);
+                need_commit_tablet_info->set_partition_id(partition_id);
+            }
         }
     }
     size_t header_len = header.ByteSizeLong();


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

Reply via email to