diff options
author | Oleg Doronin <dorooleg@yandex.ru> | 2024-12-18 16:28:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 18:28:07 +0300 |
commit | 0fc7e5f15b2010dae703f50ee89c9bbfd313862f (patch) | |
tree | 2fd28b00c81c9c66724c9cd5c64db1eaacb59233 | |
parent | 47dde79fb9f4ed8a909e68b893981e1c8ba23102 (diff) | |
download | ydb-0fc7e5f15b2010dae703f50ee89c9bbfd313862f.tar.gz |
v1 has been fixed (#12730)
-rw-r--r-- | ydb/core/fq/libs/compute/common/config.h | 13 | ||||
-rw-r--r-- | ydb/core/fq/libs/control_plane_proxy/control_plane_proxy.cpp | 13 |
2 files changed, 18 insertions, 8 deletions
diff --git a/ydb/core/fq/libs/compute/common/config.h b/ydb/core/fq/libs/compute/common/config.h index 8598dc9dc4d..d113fa78377 100644 --- a/ydb/core/fq/libs/compute/common/config.h +++ b/ydb/core/fq/libs/compute/common/config.h @@ -175,12 +175,17 @@ public: } bool YdbComputeControlPlaneEnabled(const TString& scope) const { + return YdbComputeControlPlaneEnabled(scope, FederatedQuery::QueryContent::ANALYTICS) || + YdbComputeControlPlaneEnabled(scope, FederatedQuery::QueryContent::STREAMING); + } + + bool YdbComputeControlPlaneEnabled(const TString& scope, FederatedQuery::QueryContent::QueryType queryType) const { + if (queryType == FederatedQuery::QueryContent::QUERY_TYPE_UNSPECIFIED) { + return YdbComputeControlPlaneEnabled(scope); + } return ComputeConfig.GetYdb().GetEnable() && ComputeConfig.GetYdb().GetControlPlane().GetEnable() && - (GetComputeType(FederatedQuery::QueryContent::ANALYTICS, scope) == - NFq::NConfig::EComputeType::YDB || - GetComputeType(FederatedQuery::QueryContent::STREAMING, scope) == - NFq::NConfig::EComputeType::YDB); + GetComputeType(queryType, scope) == NFq::NConfig::EComputeType::YDB; } bool IsYDBSchemaOperationsEnabled( diff --git a/ydb/core/fq/libs/control_plane_proxy/control_plane_proxy.cpp b/ydb/core/fq/libs/control_plane_proxy/control_plane_proxy.cpp index 971e77048ed..8e1ac1df030 100644 --- a/ydb/core/fq/libs/control_plane_proxy/control_plane_proxy.cpp +++ b/ydb/core/fq/libs/control_plane_proxy/control_plane_proxy.cpp @@ -402,6 +402,7 @@ class TCreateComputeDatabaseActor : public NActors::TActorBootstrapped<TCreateCo std::function<void(const TDuration&, bool, bool)> Probe; TEventRequest Event; ui32 Cookie; + FederatedQuery::QueryContent::QueryType QueryType; TInstant StartTime; public: @@ -413,7 +414,8 @@ public: const TString& scope, const std::function<void(const TDuration&, bool, bool)>& probe, TEventRequest event, - ui32 cookie) + ui32 cookie, + FederatedQuery::QueryContent::QueryType queryType = FederatedQuery::QueryContent::QUERY_TYPE_UNSPECIFIED) : Config(config) , ComputeConfig(computeConfig) , Sender(sender) @@ -423,13 +425,14 @@ public: , Probe(probe) , Event(event) , Cookie(cookie) + , QueryType(queryType) , StartTime(TInstant::Now()) { } static constexpr char ActorName[] = "YQ_CONTROL_PLANE_PROXY_CREATE_DATABASE"; void Bootstrap() { CPP_LOG_T("Create database bootstrap. CloudId: " << CloudId << " Scope: " << Scope << " Actor id: " << SelfId()); - if (!ComputeConfig.YdbComputeControlPlaneEnabled(Scope)) { + if (!ComputeConfig.YdbComputeControlPlaneEnabled(Scope, QueryType)) { Event->Get()->ComputeDatabase = FederatedQuery::Internal::ComputeDatabaseInternal{}; TActivationContext::Send(Event->Forward(ControlPlaneProxyActorId())); PassAway(); @@ -649,6 +652,7 @@ private: const int byteSize = request.ByteSize(); TActorId sender = ev->Sender; ui64 cookie = ev->Cookie; + FederatedQuery::QueryContent::QueryType queryType = request.content().type(); auto probe = [=](const TDuration& delta, bool isSuccess, bool isTimeout) { LWPROBE(CreateQueryRequest, scope, user, delta, byteSize, isSuccess, isTimeout); @@ -689,7 +693,7 @@ private: TEvControlPlaneProxy::TEvCreateQueryResponse> (Counters.GetCommonCounters(RTC_CREATE_COMPUTE_DATABASE), sender, Config, Config.ComputeConfig, cloudId, - scope, probe, ev, cookie)); + scope, probe, ev, cookie, queryType)); return; } @@ -918,6 +922,7 @@ private: const int byteSize = request.ByteSize(); TActorId sender = ev->Sender; ui64 cookie = ev->Cookie; + FederatedQuery::QueryContent::QueryType queryType = request.content().type(); auto probe = [=](const TDuration& delta, bool isSuccess, bool isTimeout) { LWPROBE(ModifyQueryRequest, scope, user, queryId, delta, byteSize, isSuccess, isTimeout); @@ -958,7 +963,7 @@ private: TEvControlPlaneProxy::TEvModifyQueryResponse> (Counters.GetCommonCounters(RTC_CREATE_COMPUTE_DATABASE), sender, Config, Config.ComputeConfig, cloudId, - scope, probe, ev, cookie)); + scope, probe, ev, cookie, queryType)); return; } |