From 73b3112393fcb78bada04d242ad3db94c3f61ecd Mon Sep 17 00:00:00 2001 From: Daniil Cherednik Date: Thu, 23 Jan 2025 17:54:48 +0100 Subject: [PATCH] Do not pass ParticipantNodes via protobuf for local event. --- ydb/core/kqp/executer_actor/kqp_executer.h | 2 ++ ydb/core/kqp/executer_actor/kqp_executer_impl.h | 6 ++---- ydb/core/kqp/session_actor/kqp_query_state.h | 2 +- ydb/core/kqp/session_actor/kqp_session_actor.cpp | 6 ++---- ydb/core/protos/kqp.proto | 1 - 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ydb/core/kqp/executer_actor/kqp_executer.h b/ydb/core/kqp/executer_actor/kqp_executer.h index cff40b050bcf..14714df5500a 100644 --- a/ydb/core/kqp/executer_actor/kqp_executer.h +++ b/ydb/core/kqp/executer_actor/kqp_executer.h @@ -34,6 +34,8 @@ struct TEvKqpExecuter { ui64 ResultRowsCount = 0; ui64 ResultRowsBytes = 0; + THashSet ParticipantNodes; + enum class EExecutionType { Data, Scan, diff --git a/ydb/core/kqp/executer_actor/kqp_executer_impl.h b/ydb/core/kqp/executer_actor/kqp_executer_impl.h index 9adcfb8b492b..4f1b24449612 100644 --- a/ydb/core/kqp/executer_actor/kqp_executer_impl.h +++ b/ydb/core/kqp/executer_actor/kqp_executer_impl.h @@ -1897,6 +1897,8 @@ class TKqpExecuterBase : public TActor { void PassAway() override { YQL_ENSURE(AlreadyReplied && ResponseEv); + ResponseEv->ParticipantNodes = std::move(ParticipantNodes); + // Fill response stats { auto& response = *ResponseEv->Record.MutableResponse(); @@ -1923,10 +1925,6 @@ class TKqpExecuterBase : public TActor { LOG_I("Full stats: " << response.GetResult().GetStats()); } } - - for (const auto nodeId : ParticipantNodes) { - response.MutableResult()->AddParticipantNodes(nodeId); - } } Request.Transactions.crop(0); diff --git a/ydb/core/kqp/session_actor/kqp_query_state.h b/ydb/core/kqp/session_actor/kqp_query_state.h index 140a42ab4159..ecbd3a5348ed 100644 --- a/ydb/core/kqp/session_actor/kqp_query_state.h +++ b/ydb/core/kqp/session_actor/kqp_query_state.h @@ -170,7 +170,7 @@ class TKqpQueryState : public TNonCopyable { ui32 StatementResultSize = 0; TMaybe CommandTagName; - THashSet ParticipantNodes; + THashSet ParticipantNodes; bool IsLocalExecution(ui32 nodeId) const { if (RequestEv->GetRequestCtx() == nullptr) { diff --git a/ydb/core/kqp/session_actor/kqp_session_actor.cpp b/ydb/core/kqp/session_actor/kqp_session_actor.cpp index 991684611022..ca4643e691ec 100644 --- a/ydb/core/kqp/session_actor/kqp_session_actor.cpp +++ b/ydb/core/kqp/session_actor/kqp_session_actor.cpp @@ -1554,10 +1554,8 @@ class TKqpSessionActor : public TActorBootstrapped { QueryState->QueryStats.Executions.back().Swap(executerResults.MutableStats()); } - if (executerResults.ParticipantNodesSize()) { - for (auto nodeId : executerResults.GetParticipantNodes()) { - QueryState->ParticipantNodes.emplace(nodeId); - } + for (auto nodeId : ev->ParticipantNodes) { + QueryState->ParticipantNodes.emplace(nodeId); } if (response->GetStatus() != Ydb::StatusIds::SUCCESS) { diff --git a/ydb/core/protos/kqp.proto b/ydb/core/protos/kqp.proto index e2633db12276..301f7c5f9ce5 100644 --- a/ydb/core/protos/kqp.proto +++ b/ydb/core/protos/kqp.proto @@ -446,7 +446,6 @@ message TExecuterTxResult { reserved 5; // (deprecated) Stats optional NYql.NDqProto.TDqExecutionStats Stats = 6; reserved 7; - repeated uint32 ParticipantNodes = 8; }; message TExecuterTxResponse {