From 9f0300568f15c1aa391956c02618c2d340cbbf3e Mon Sep 17 00:00:00 2001 From: Kaijie Chen Date: Mon, 29 Jan 2024 19:51:44 +0800 Subject: [PATCH] [fix](move-memtable) fix potential duplicate of TabletStream profile (#30397) --- be/src/runtime/load_stream.cpp | 2 +- be/test/runtime/load_stream_test.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/be/src/runtime/load_stream.cpp b/be/src/runtime/load_stream.cpp index cbd52251b294a2..4450d40ad9bae4 100644 --- a/be/src/runtime/load_stream.cpp +++ b/be/src/runtime/load_stream.cpp @@ -292,8 +292,8 @@ Status IndexStream::_init_tablet_stream(TabletStreamSharedPtr& tablet_stream, in int64_t partition_id) { tablet_stream = std::make_shared(_load_id, tablet_id, _txn_id, _load_stream_mgr, _profile); - RETURN_IF_ERROR(tablet_stream->init(_schema, _id, partition_id)); _tablet_streams_map[tablet_id] = tablet_stream; + RETURN_IF_ERROR(tablet_stream->init(_schema, _id, partition_id)); return Status::OK(); } diff --git a/be/test/runtime/load_stream_test.cpp b/be/test/runtime/load_stream_test.cpp index 70e59a81f278f9..89535642436dc9 100644 --- a/be/test/runtime/load_stream_test.cpp +++ b/be/test/runtime/load_stream_test.cpp @@ -807,7 +807,8 @@ TEST_F(LoadStreamMgrTest, one_client_abnormal_tablet) { wait_for_ack(3); EXPECT_EQ(g_response_stat.num, 3); EXPECT_EQ(g_response_stat.success_tablet_ids.size(), 0); - EXPECT_EQ(g_response_stat.failed_tablet_ids.size(), 1); + EXPECT_EQ(g_response_stat.failed_tablet_ids.size(), 2); + EXPECT_EQ(g_response_stat.failed_tablet_ids[1], ABNORMAL_TABLET_ID); // server will close stream on CLOSE_LOAD wait_for_close();