diff options
author | Vladislav Kuznetsov <va.kuznecov@physics.msu.ru> | 2022-06-06 16:47:06 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-06-06 16:47:06 +0300 |
commit | 6ce12a7f532fd21519bb709b0eb84d734808cb2d (patch) | |
tree | 33ccce712d4bfe3f682a01ce99498115c0e57c5c | |
parent | e5bf26f27f4448ee053de0654ceb83401b0b4aef (diff) | |
download | ydb-6ce12a7f532fd21519bb709b0eb84d734808cb2d.tar.gz |
Merge 22-2. Reply error on request with empty TxControl (WorkerActor) KIKIMR-14982
REVIEW: 2585988
REVIEW: 2590632
x-ydb-stable-ref: 427f6504a07aedc34a986d788c0c629ad6b44887
-rw-r--r-- | ydb/core/kqp/kqp_worker_actor.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ydb/core/kqp/kqp_worker_actor.cpp b/ydb/core/kqp/kqp_worker_actor.cpp index 03fce1de6a..294bfc52ff 100644 --- a/ydb/core/kqp/kqp_worker_actor.cpp +++ b/ydb/core/kqp/kqp_worker_actor.cpp @@ -366,6 +366,14 @@ public: QueryState->OldEngineFallback = true; } + auto replyError = [this, &ctx] (NYql::EYqlIssueCode status, const TString& info) { + QueryState->AsyncQueryResult = MakeKikimrResultHolder(NCommon::ResultFromError<TQueryResult>( + YqlIssue(TPosition(), status, info))); + + ContinueQueryProcess(ctx); + Become(&TKqpWorkerActor::PerformQueryState); + }; + if (queryRequest.HasTxControl()) { const auto& txControl = queryRequest.GetTxControl(); @@ -375,12 +383,7 @@ public: auto txInfo = KqpHost->GetTransactionInfo(QueryState->TxId); if (!txInfo) { - QueryState->AsyncQueryResult = MakeKikimrResultHolder(NCommon::ResultFromError<TQueryResult>( - YqlIssue(TPosition(), TIssuesIds::KIKIMR_TRANSACTION_NOT_FOUND, TStringBuilder() - << "Transaction not found: " << QueryState->TxId))); - - ContinueQueryProcess(ctx); - Become(&TKqpWorkerActor::PerformQueryState); + replyError(TIssuesIds::KIKIMR_TRANSACTION_NOT_FOUND, TStringBuilder() << "Transaction not found: " << QueryState->TxId); return; } @@ -400,7 +403,8 @@ public: } case Ydb::Table::TransactionControl::TX_SELECTOR_NOT_SET: { - Y_VERIFY(false); + replyError(TIssuesIds::KIKIMR_BAD_REQUEST, TStringBuilder() << "wrong TxControl: tx_selector must be set"); + return; } } } else { |