From 85559863a81aa30b4c030192148aa230f20731fa Mon Sep 17 00:00:00 2001 From: meegoo Date: Thu, 9 Nov 2023 23:25:14 -0800 Subject: [PATCH] [BugFix] Fix automatic partition write data into wrong partition when many partition created concurrency (#34731) 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 cd2a1b68784d6..b41902211475d 100644 --- a/be/src/runtime/lake_tablets_channel.cpp +++ b/be/src/runtime/lake_tablets_channel.cpp @@ -443,7 +443,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 140e41d08a6d6..31b4fb5cb9c30 100644 --- a/be/src/runtime/local_tablets_channel.cpp +++ b/be/src/runtime/local_tablets_channel.cpp @@ -740,7 +740,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; } }