From 95e9ccf7fd534c2bd23d70023e2a83e01a4e7fe1 Mon Sep 17 00:00:00 2001 From: meegoo Date: Fri, 10 Nov 2023 12:28:23 +0800 Subject: [PATCH] [BugFix] Fix automatic partition write data into wrong partition when many partition created concurrency Signed-off-by: meegoo --- be/src/runtime/lake_tablets_channel.cpp | 2 +- be/src/runtime/local_tablets_channel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/runtime/lake_tablets_channel.cpp b/be/src/runtime/lake_tablets_channel.cpp index 0841ead06ecca..9ec6c76475a45 100644 --- a/be/src/runtime/lake_tablets_channel.cpp +++ b/be/src/runtime/lake_tablets_channel.cpp @@ -537,7 +537,7 @@ Status LakeTabletsChannel::_create_delta_writers(const PTabletWriterOpenRequest& std::sort(tablet_ids.begin(), tablet_ids.end()); DCHECK_EQ(_delta_writers.size(), tablet_ids.size()); for (size_t i = 0; i < tablet_ids.size(); ++i) { - _tablet_id_to_sorted_indexes.emplace(tablet_ids[i], i); + _tablet_id_to_sorted_indexes[tablet_ids[i]] = i; } } return Status::OK(); diff --git a/be/src/runtime/local_tablets_channel.cpp b/be/src/runtime/local_tablets_channel.cpp index fd13a22380541..b141e2525d058 100644 --- a/be/src/runtime/local_tablets_channel.cpp +++ b/be/src/runtime/local_tablets_channel.cpp @@ -834,7 +834,7 @@ Status LocalTabletsChannel::incremental_open(const PTabletWriterOpenRequest& par DCHECK_EQ(_delta_writers.size(), tablet_ids.size()); std::sort(tablet_ids.begin(), tablet_ids.end()); for (size_t i = 0; i < tablet_ids.size(); ++i) { - _tablet_id_to_sorted_indexes.emplace(tablet_ids[i], i); + _tablet_id_to_sorted_indexes[tablet_ids[i]] = i; } }