diff options
author | gvit <gvit@ydb.tech> | 2023-03-09 11:44:11 +0300 |
---|---|---|
committer | gvit <gvit@ydb.tech> | 2023-03-09 11:44:11 +0300 |
commit | 039e25e1597bec288de44e5061c1b84e195add08 (patch) | |
tree | c17c8a630df92ba8bfe75eadb52b487fd7c6861c | |
parent | 9070418e6da5d6031fed22ea2bd425bc4e948311 (diff) | |
download | ydb-039e25e1597bec288de44e5061c1b84e195add08.tar.gz |
trivial: data executer can share mailbox with CA if there is only one CA
-rw-r--r-- | ydb/core/kqp/executer_actor/kqp_data_executer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ydb/core/kqp/executer_actor/kqp_data_executer.cpp b/ydb/core/kqp/executer_actor/kqp_data_executer.cpp index 23fb451104..12936d3c85 100644 --- a/ydb/core/kqp/executer_actor/kqp_data_executer.cpp +++ b/ydb/core/kqp/executer_actor/kqp_data_executer.cpp @@ -1576,7 +1576,7 @@ private: YQL_ENSURE(result.second); } - void ExecuteDataComputeTask(NDqProto::TDqTask&& taskDesc) { + void ExecuteDataComputeTask(NDqProto::TDqTask&& taskDesc, bool shareMailbox) { auto taskId = taskDesc.GetId(); auto& task = TasksGraph.GetTask(taskId); @@ -1603,7 +1603,8 @@ private: auto computeActor = CreateKqpComputeActor(SelfId(), TxId, std::move(taskDesc), CreateKqpAsyncIoFactory(Counters->Counters), AppData()->FunctionRegistry, settings, limits); - auto computeActorId = Register(computeActor); + + auto computeActorId = shareMailbox ? RegisterWithSameMailbox(computeActor) : Register(computeActor); task.ComputeActorId = computeActorId; LOG_D("Executing task: " << taskId << " on compute actor: " << task.ComputeActorId); @@ -2156,10 +2157,11 @@ private: // first, start compute tasks TVector<ui64> computeTaskIds{Reserve(ComputeTasks.size())}; + bool shareMailbox = (ComputeTasks.size() <= 1); for (auto&& taskDesc : ComputeTasks) { computeTaskIds.emplace_back(taskDesc.GetId()); FillInputSettings(taskDesc); - ExecuteDataComputeTask(std::move(taskDesc)); + ExecuteDataComputeTask(std::move(taskDesc), shareMailbox); } size_t remoteComputeTasksCnt = 0; |