diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp index 42df9df4fe6a..7923ae5f7384 100644 --- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp @@ -2148,7 +2148,7 @@ void TKqpServiceInitializer::InitializeServices(NActors::TActorSystemSetup* setu auto s3ActorsFactory = NYql::NDq::CreateS3ActorsFactory(); auto proxy = NKqp::CreateKqpProxyService(Config.GetLogConfig(), Config.GetTableServiceConfig(), - Config.GetQueryServiceConfig(), Config.GetMetadataProviderConfig(), std::move(settings), Factories->QueryReplayBackendFactory, std::move(kqpProxySharedResources), + Config.GetQueryServiceConfig(), std::move(settings), Factories->QueryReplayBackendFactory, std::move(kqpProxySharedResources), federatedQuerySetupFactory, s3ActorsFactory ); setup->LocalServices.push_back(std::make_pair( @@ -2157,7 +2157,7 @@ void TKqpServiceInitializer::InitializeServices(NActors::TActorSystemSetup* setu // Create finalize script service auto finalize = NKqp::CreateKqpFinalizeScriptService( - Config.GetQueryServiceConfig(), Config.GetMetadataProviderConfig(), federatedQuerySetupFactory, s3ActorsFactory + Config.GetQueryServiceConfig(), federatedQuerySetupFactory, s3ActorsFactory ); setup->LocalServices.push_back(std::make_pair( NKqp::MakeKqpFinalizeScriptServiceId(NodeId), diff --git a/ydb/core/kqp/compile_service/kqp_compile_actor.cpp b/ydb/core/kqp/compile_service/kqp_compile_actor.cpp index c925489cffd8..9c84e660871a 100644 --- a/ydb/core/kqp/compile_service/kqp_compile_actor.cpp +++ b/ydb/core/kqp/compile_service/kqp_compile_actor.cpp @@ -45,7 +45,6 @@ class TKqpCompileActor : public TActorBootstrapped { TKqpCompileActor(const TActorId& owner, const TKqpSettings::TConstPtr& kqpSettings, const TTableServiceConfig& tableServiceConfig, const TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, const TGUCSettings::TPtr& gUCSettings, const TMaybe& applicationName, const TString& uid, const TKqpQueryId& queryId, @@ -70,7 +69,6 @@ class TKqpCompileActor : public TActorBootstrapped { , DbCounters(dbCounters) , Config(MakeIntrusive()) , QueryServiceConfig(queryServiceConfig) - , MetadataProviderConfig(metadataProviderConfig) , CompilationTimeout(TDuration::MilliSeconds(tableServiceConfig.GetCompileTimeoutMs())) , UserRequestContext(userRequestContext) , CompileActorSpan(TWilsonKqp::CompileActor, std::move(traceId), "CompileActor") @@ -269,7 +267,7 @@ class TKqpCompileActor : public TActorBootstrapped { counters->TxProxyMon = new NTxProxy::TTxProxyMon(AppData(ctx)->Counters); std::shared_ptr loader = std::make_shared( - QueryId.Cluster, TlsActivationContext->ActorSystem(), Config, true, TempTablesState, 2 * TDuration::Seconds(MetadataProviderConfig.GetRefreshPeriodSeconds())); + QueryId.Cluster, TlsActivationContext->ActorSystem(), Config, true, TempTablesState); Gateway = CreateKikimrIcGateway(QueryId.Cluster, QueryId.Settings.QueryType, QueryId.Database, std::move(loader), ctx.ExecutorThread.ActorSystem, ctx.SelfID.NodeId(), counters, QueryServiceConfig); Gateway->SetToken(QueryId.Cluster, UserToken); @@ -556,7 +554,6 @@ class TKqpCompileActor : public TActorBootstrapped { TKqpDbCountersPtr DbCounters; TKikimrConfiguration::TPtr Config; TQueryServiceConfig QueryServiceConfig; - TMetadataProviderConfig MetadataProviderConfig; TDuration CompilationTimeout; TInstant StartTime; TDuration CompileCpuTime; @@ -622,7 +619,6 @@ void ApplyServiceConfig(TKikimrConfiguration& kqpConfig, const TTableServiceConf IActor* CreateKqpCompileActor(const TActorId& owner, const TKqpSettings::TConstPtr& kqpSettings, const TTableServiceConfig& tableServiceConfig, const TQueryServiceConfig& queryServiceConfig, - const TMetadataProviderConfig& metadataProviderConfig, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, const TString& uid, const TKqpQueryId& query, const TIntrusiveConstPtr& userToken, std::optional federatedQuerySetup, TKqpDbCountersPtr dbCounters, const TGUCSettings::TPtr& gUCSettings, @@ -631,7 +627,7 @@ IActor* CreateKqpCompileActor(const TActorId& owner, const TKqpSettings::TConstP ECompileActorAction compileAction, TMaybe queryAst, bool collectFullDiagnostics, bool perStatementResult, NYql::TExprContext* splitCtx, NYql::TExprNode::TPtr splitExpr) { - return new TKqpCompileActor(owner, kqpSettings, tableServiceConfig, queryServiceConfig, metadataProviderConfig, + return new TKqpCompileActor(owner, kqpSettings, tableServiceConfig, queryServiceConfig, moduleResolverState, counters, gUCSettings, applicationName, uid, query, userToken, dbCounters, federatedQuerySetup, userRequestContext, diff --git a/ydb/core/kqp/compile_service/kqp_compile_service.cpp b/ydb/core/kqp/compile_service/kqp_compile_service.cpp index 01f1615cc466..c435eb7f6f02 100644 --- a/ydb/core/kqp/compile_service/kqp_compile_service.cpp +++ b/ydb/core/kqp/compile_service/kqp_compile_service.cpp @@ -441,14 +441,13 @@ class TKqpCompileService : public TActorBootstrapped { } TKqpCompileService(const TTableServiceConfig& tableServiceConfig, const TQueryServiceConfig& queryServiceConfig, - const TMetadataProviderConfig& metadataProviderConfig, const TKqpSettings::TConstPtr& kqpSettings, + const TKqpSettings::TConstPtr& kqpSettings, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, std::shared_ptr queryReplayFactory, std::optional federatedQuerySetup ) : TableServiceConfig(tableServiceConfig) , QueryServiceConfig(queryServiceConfig) - , MetadataProviderConfig(metadataProviderConfig) , KqpSettings(kqpSettings) , ModuleResolverState(moduleResolverState) , Counters(counters) @@ -1058,7 +1057,7 @@ class TKqpCompileService : public TActorBootstrapped { } void StartCompilation(TKqpCompileRequest&& request, const TActorContext& ctx) { - auto compileActor = CreateKqpCompileActor(ctx.SelfID, KqpSettings, TableServiceConfig, QueryServiceConfig, MetadataProviderConfig, ModuleResolverState, Counters, + auto compileActor = CreateKqpCompileActor(ctx.SelfID, KqpSettings, TableServiceConfig, QueryServiceConfig, ModuleResolverState, Counters, request.Uid, request.Query, request.UserToken, FederatedQuerySetup, request.DbCounters, request.GUCSettings, request.ApplicationName, request.UserRequestContext, request.CompileServiceSpan.GetTraceId(), request.TempTablesState, request.CompileSettings.Action, std::move(request.QueryAst), CollectDiagnostics, request.CompileSettings.PerStatementResult, request.SplitCtx, request.SplitExpr); @@ -1171,7 +1170,6 @@ class TKqpCompileService : public TActorBootstrapped { private: TTableServiceConfig TableServiceConfig; TQueryServiceConfig QueryServiceConfig; - TMetadataProviderConfig MetadataProviderConfig; TKqpSettings::TConstPtr KqpSettings; TIntrusivePtr ModuleResolverState; TIntrusivePtr Counters; @@ -1186,13 +1184,12 @@ class TKqpCompileService : public TActorBootstrapped { }; IActor* CreateKqpCompileService(const TTableServiceConfig& tableServiceConfig, const TQueryServiceConfig& queryServiceConfig, - const TMetadataProviderConfig& metadataProviderConfig, const TKqpSettings::TConstPtr& kqpSettings, - TIntrusivePtr moduleResolverState, TIntrusivePtr counters, + const TKqpSettings::TConstPtr& kqpSettings, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, std::shared_ptr queryReplayFactory, std::optional federatedQuerySetup ) { - return new TKqpCompileService(tableServiceConfig, queryServiceConfig, metadataProviderConfig, kqpSettings, moduleResolverState, counters, + return new TKqpCompileService(tableServiceConfig, queryServiceConfig, kqpSettings, moduleResolverState, counters, std::move(queryReplayFactory), federatedQuerySetup); } diff --git a/ydb/core/kqp/compile_service/kqp_compile_service.h b/ydb/core/kqp/compile_service/kqp_compile_service.h index a47ce0ac4b3f..1cf414354345 100644 --- a/ydb/core/kqp/compile_service/kqp_compile_service.h +++ b/ydb/core/kqp/compile_service/kqp_compile_service.h @@ -16,7 +16,6 @@ enum class ECompileActorAction { IActor* CreateKqpCompileService(const NKikimrConfig::TTableServiceConfig& tableServiceConfig, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const TKqpSettings::TConstPtr& kqpSettings, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, std::shared_ptr queryReplayFactory, std::optional federatedQuerySetup @@ -28,7 +27,6 @@ IActor* CreateKqpCompileComputationPatternService(const NKikimrConfig::TTableSer IActor* CreateKqpCompileActor(const TActorId& owner, const TKqpSettings::TConstPtr& kqpSettings, const NKikimrConfig::TTableServiceConfig& tableServiceConfig, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, const TString& uid, const TKqpQueryId& query, const TIntrusiveConstPtr& userToken, diff --git a/ydb/core/kqp/executer_actor/kqp_data_executer.cpp b/ydb/core/kqp/executer_actor/kqp_data_executer.cpp index 053a1e51ba1d..98ac4c881aed 100644 --- a/ydb/core/kqp/executer_actor/kqp_data_executer.cpp +++ b/ydb/core/kqp/executer_actor/kqp_data_executer.cpp @@ -128,11 +128,11 @@ class TKqpDataExecuter : public TKqpExecuterBase& userRequestContext, + const TActorId& creator, const TIntrusivePtr& userRequestContext, const bool enableOlapSink, const bool useEvWrite, ui32 statementResultIndex, const std::optional& federatedQuerySetup, const TGUCSettings::TPtr& GUCSettings) : TBase(std::move(request), database, userToken, counters, executerRetriesConfig, chanTransportVersion, aggregation, - maximalSecretsSnapshotWaitTime, userRequestContext, statementResultIndex, TWilsonKqp::DataExecuter, "DataExecuter", streamResult) + userRequestContext, statementResultIndex, TWilsonKqp::DataExecuter, "DataExecuter", streamResult) , AsyncIoFactory(std::move(asyncIoFactory)) , EnableOlapSink(enableOlapSink) , UseEvWrite(useEvWrite) @@ -2737,12 +2737,12 @@ IActor* CreateKqpDataExecuter(IKqpGateway::TExecPhysicalRequest&& request, const TKqpRequestCounters::TPtr counters, bool streamResult, const NKikimrConfig::TTableServiceConfig::TAggregationConfig& aggregation, const NKikimrConfig::TTableServiceConfig::TExecuterRetriesConfig& executerRetriesConfig, NYql::NDq::IDqAsyncIoFactory::TPtr asyncIoFactory, const NKikimrConfig::TTableServiceConfig::EChannelTransportVersion chanTransportVersion, const TActorId& creator, - TDuration maximalSecretsSnapshotWaitTime, const TIntrusivePtr& userRequestContext, + const TIntrusivePtr& userRequestContext, const bool enableOlapSink, const bool useEvWrite, ui32 statementResultIndex, const std::optional& federatedQuerySetup, const TGUCSettings::TPtr& GUCSettings) { return new TKqpDataExecuter(std::move(request), database, userToken, counters, streamResult, executerRetriesConfig, - std::move(asyncIoFactory), chanTransportVersion, aggregation, creator, maximalSecretsSnapshotWaitTime, userRequestContext, + std::move(asyncIoFactory), chanTransportVersion, aggregation, creator, userRequestContext, enableOlapSink, useEvWrite, statementResultIndex, federatedQuerySetup, GUCSettings); } diff --git a/ydb/core/kqp/executer_actor/kqp_executer.h b/ydb/core/kqp/executer_actor/kqp_executer.h index a3ffd0524601..a871450170d7 100644 --- a/ydb/core/kqp/executer_actor/kqp_executer.h +++ b/ydb/core/kqp/executer_actor/kqp_executer.h @@ -102,7 +102,7 @@ IActor* CreateKqpExecuter(IKqpGateway::TExecPhysicalRequest&& request, const TSt const NKikimrConfig::TTableServiceConfig::TExecuterRetriesConfig& executerRetriesConfig, NYql::NDq::IDqAsyncIoFactory::TPtr asyncIoFactory, TPreparedQueryHolder::TConstPtr preparedQuery, const NKikimrConfig::TTableServiceConfig::EChannelTransportVersion chanTransportVersion, const TActorId& creator, - TDuration maximalSecretsSnapshotWaitTime, const TIntrusivePtr& userRequestContext, + const TIntrusivePtr& userRequestContext, const bool enableOlapSink, const bool useEvWrite, ui32 statementResultIndex, const std::optional& federatedQuerySetup, const TGUCSettings::TPtr& GUCSettings); diff --git a/ydb/core/kqp/executer_actor/kqp_executer_impl.cpp b/ydb/core/kqp/executer_actor/kqp_executer_impl.cpp index f688d6c6add5..cd7f9d3830cc 100644 --- a/ydb/core/kqp/executer_actor/kqp_executer_impl.cpp +++ b/ydb/core/kqp/executer_actor/kqp_executer_impl.cpp @@ -82,7 +82,7 @@ IActor* CreateKqpExecuter(IKqpGateway::TExecPhysicalRequest&& request, const TSt const NKikimrConfig::TTableServiceConfig::TExecuterRetriesConfig& executerRetriesConfig, NYql::NDq::IDqAsyncIoFactory::TPtr asyncIoFactory, TPreparedQueryHolder::TConstPtr preparedQuery, const NKikimrConfig::TTableServiceConfig::EChannelTransportVersion chanTransportVersion, const TActorId& creator, - TDuration maximalSecretsSnapshotWaitTime, const TIntrusivePtr& userRequestContext, + const TIntrusivePtr& userRequestContext, const bool enableOlapSink, const bool useEvWrite, ui32 statementResultIndex, const std::optional& federatedQuerySetup, const TGUCSettings::TPtr& GUCSettings) { @@ -92,7 +92,7 @@ IActor* CreateKqpExecuter(IKqpGateway::TExecPhysicalRequest&& request, const TSt return CreateKqpDataExecuter( std::move(request), database, userToken, counters, false, aggregation, executerRetriesConfig, std::move(asyncIoFactory), chanTransportVersion, creator, - maximalSecretsSnapshotWaitTime, userRequestContext, enableOlapSink, useEvWrite, statementResultIndex, + userRequestContext, enableOlapSink, useEvWrite, statementResultIndex, federatedQuerySetup, /*GUCSettings*/nullptr ); } @@ -115,14 +115,14 @@ IActor* CreateKqpExecuter(IKqpGateway::TExecPhysicalRequest&& request, const TSt return CreateKqpDataExecuter( std::move(request), database, userToken, counters, false, aggregation, executerRetriesConfig, std::move(asyncIoFactory), chanTransportVersion, creator, - maximalSecretsSnapshotWaitTime, userRequestContext, enableOlapSink, useEvWrite, statementResultIndex, + userRequestContext, enableOlapSink, useEvWrite, statementResultIndex, federatedQuerySetup, /*GUCSettings*/nullptr ); case NKqpProto::TKqpPhyTx::TYPE_SCAN: return CreateKqpScanExecuter( std::move(request), database, userToken, counters, aggregation, - executerRetriesConfig, preparedQuery, chanTransportVersion, maximalSecretsSnapshotWaitTime, userRequestContext, + executerRetriesConfig, preparedQuery, chanTransportVersion, userRequestContext, statementResultIndex ); @@ -130,7 +130,7 @@ IActor* CreateKqpExecuter(IKqpGateway::TExecPhysicalRequest&& request, const TSt return CreateKqpDataExecuter( std::move(request), database, userToken, counters, true, aggregation, executerRetriesConfig, std::move(asyncIoFactory), chanTransportVersion, creator, - maximalSecretsSnapshotWaitTime, userRequestContext, enableOlapSink, useEvWrite, statementResultIndex, + userRequestContext, enableOlapSink, useEvWrite, statementResultIndex, federatedQuerySetup, GUCSettings ); diff --git a/ydb/core/kqp/executer_actor/kqp_executer_impl.h b/ydb/core/kqp/executer_actor/kqp_executer_impl.h index d37d611182ed..4bfb1ec0ad86 100644 --- a/ydb/core/kqp/executer_actor/kqp_executer_impl.h +++ b/ydb/core/kqp/executer_actor/kqp_executer_impl.h @@ -126,7 +126,7 @@ class TKqpExecuterBase : public TActorBootstrapped { const NKikimrConfig::TTableServiceConfig::TExecuterRetriesConfig& executerRetriesConfig, const NKikimrConfig::TTableServiceConfig::EChannelTransportVersion chanTransportVersion, const NKikimrConfig::TTableServiceConfig::TAggregationConfig& aggregation, - TDuration maximalSecretsSnapshotWaitTime, const TIntrusivePtr& userRequestContext, + const TIntrusivePtr& userRequestContext, ui32 statementResultIndex, ui64 spanVerbosity = 0, TString spanName = "KqpExecuterBase", bool streamResult = false) : Request(std::move(request)) , Database(database) @@ -135,7 +135,6 @@ class TKqpExecuterBase : public TActorBootstrapped { , ExecuterSpan(spanVerbosity, std::move(Request.TraceId), spanName) , Planner(nullptr) , ExecuterRetriesConfig(executerRetriesConfig) - , MaximalSecretsSnapshotWaitTime(maximalSecretsSnapshotWaitTime) , AggregationSettings(aggregation) , HasOlapTable(false) , StreamResult(streamResult) @@ -1645,7 +1644,7 @@ class TKqpExecuterBase : public TActorBootstrapped { } void GetSecretsSnapshot() { - RegisterDescribeSecretsActor(this->SelfId(), UserToken ? UserToken->GetUserSID() : "", SecretNames, this->ActorContext().ActorSystem(), MaximalSecretsSnapshotWaitTime); + RegisterDescribeSecretsActor(this->SelfId(), UserToken ? UserToken->GetUserSID() : "", SecretNames, this->ActorContext().ActorSystem()); } void GetResourcesSnapshot() { @@ -1971,7 +1970,6 @@ class TKqpExecuterBase : public TActorBootstrapped { std::vector SecretNames; std::map SecureParams; - TDuration MaximalSecretsSnapshotWaitTime; const NKikimrConfig::TTableServiceConfig::TAggregationConfig AggregationSettings; TVector ResourcesSnapshot; @@ -1998,7 +1996,7 @@ IActor* CreateKqpDataExecuter(IKqpGateway::TExecPhysicalRequest&& request, const const NKikimrConfig::TTableServiceConfig::TExecuterRetriesConfig& executerRetriesConfig, NYql::NDq::IDqAsyncIoFactory::TPtr asyncIoFactory, const NKikimrConfig::TTableServiceConfig::EChannelTransportVersion chanTransportVersion, const TActorId& creator, - TDuration maximalSecretsSnapshotWaitTime, const TIntrusivePtr& userRequestContext, + const TIntrusivePtr& userRequestContext, const bool enableOlapSink, const bool useEvWrite, ui32 statementResultIndex, const std::optional& federatedQuerySetup, const TGUCSettings::TPtr& GUCSettings); @@ -2007,7 +2005,7 @@ IActor* CreateKqpScanExecuter(IKqpGateway::TExecPhysicalRequest&& request, const const NKikimrConfig::TTableServiceConfig::TAggregationConfig& aggregation, const NKikimrConfig::TTableServiceConfig::TExecuterRetriesConfig& executerRetriesConfig, TPreparedQueryHolder::TConstPtr preparedQuery, const NKikimrConfig::TTableServiceConfig::EChannelTransportVersion chanTransportVersion, - TDuration maximalSecretsSnapshotWaitTime, const TIntrusivePtr& userRequestContext, ui32 statementResultIndex); + const TIntrusivePtr& userRequestContext, ui32 statementResultIndex); } // namespace NKqp } // namespace NKikimr diff --git a/ydb/core/kqp/executer_actor/kqp_scan_executer.cpp b/ydb/core/kqp/executer_actor/kqp_scan_executer.cpp index 790488bcb6be..771b15510290 100644 --- a/ydb/core/kqp/executer_actor/kqp_scan_executer.cpp +++ b/ydb/core/kqp/executer_actor/kqp_scan_executer.cpp @@ -49,10 +49,10 @@ class TKqpScanExecuter : public TKqpExecuterBase& userRequestContext, + const TIntrusivePtr& userRequestContext, ui32 statementResultIndex) : TBase(std::move(request), database, userToken, counters, executerRetriesConfig, chanTransportVersion, aggregation, - maximalSecretsSnapshotWaitTime, userRequestContext, statementResultIndex, TWilsonKqp::ScanExecuter, "ScanExecuter", + userRequestContext, statementResultIndex, TWilsonKqp::ScanExecuter, "ScanExecuter", false ) , PreparedQuery(preparedQuery) @@ -388,10 +388,10 @@ IActor* CreateKqpScanExecuter(IKqpGateway::TExecPhysicalRequest&& request, const const NKikimrConfig::TTableServiceConfig::TAggregationConfig& aggregation, const NKikimrConfig::TTableServiceConfig::TExecuterRetriesConfig& executerRetriesConfig, TPreparedQueryHolder::TConstPtr preparedQuery, const NKikimrConfig::TTableServiceConfig::EChannelTransportVersion chanTransportVersion, - TDuration maximalSecretsSnapshotWaitTime, const TIntrusivePtr& userRequestContext, ui32 statementResultIndex) + const TIntrusivePtr& userRequestContext, ui32 statementResultIndex) { return new TKqpScanExecuter(std::move(request), database, userToken, counters, aggregation, executerRetriesConfig, - preparedQuery, chanTransportVersion, maximalSecretsSnapshotWaitTime, userRequestContext, statementResultIndex); + preparedQuery, chanTransportVersion, userRequestContext, statementResultIndex); } } // namespace NKqp diff --git a/ydb/core/kqp/federated_query/kqp_federated_query_actors.cpp b/ydb/core/kqp/federated_query/kqp_federated_query_actors.cpp index d7ff242e34e8..c6150636e5df 100644 --- a/ydb/core/kqp/federated_query/kqp_federated_query_actors.cpp +++ b/ydb/core/kqp/federated_query/kqp_federated_query_actors.cpp @@ -11,7 +11,6 @@ namespace { class TDescribeSecretsActor: public NActors::TActorBootstrapped { STRICT_STFUNC(StateFunc, hFunc(NMetadata::NProvider::TEvRefreshSubscriberData, Handle); - hFunc(NActors::TEvents::TEvWakeup, Handle); ) void Handle(NMetadata::NProvider::TEvRefreshSubscriberData::TPtr& ev) { @@ -23,9 +22,11 @@ class TDescribeSecretsActor: public NActors::TActorBootstrappedGetSecretValue(NMetadata::NSecret::TSecretIdOrValue::BuildAsId(secretId), secretValue); if (!isFound) { - LastResponse = TEvDescribeSecretsResponse::TDescription(Ydb::StatusIds::BAD_REQUEST, { NYql::TIssue("secret with name '" + secretId.GetSecretId() + "' not found") }); - if (!SubscribedOnSecrets) { - CompleteAndPassAway(LastResponse); + if (!AskSent) { + AskSent = true; + Send(NMetadata::NProvider::MakeServiceId(SelfId().NodeId()), new NMetadata::NProvider::TEvAskSnapshot(GetSecretsSnapshotParser())); + } else { + CompleteAndPassAway(TEvDescribeSecretsResponse::TDescription(Ydb::StatusIds::BAD_REQUEST, { NYql::TIssue("secret with name '" + secretId.GetSecretId() + "' not found") })); } return; } @@ -35,16 +36,10 @@ class TDescribeSecretsActor: public NActors::TActorBootstrappedSend(NMetadata::NProvider::MakeServiceId(SelfId().NodeId()), new NMetadata::NProvider::TEvUnsubscribeExternal(GetSecretsSnapshotParser())); - } + Send(NMetadata::NProvider::MakeServiceId(SelfId().NodeId()), new NMetadata::NProvider::TEvUnsubscribeExternal(GetSecretsSnapshotParser())); PassAway(); } @@ -53,11 +48,9 @@ class TDescribeSecretsActor: public NActors::TActorBootstrapped& secretIds, NThreading::TPromise promise, TDuration maximalSecretsSnapshotWaitTime) + TDescribeSecretsActor(const TString& ownerUserId, const std::vector& secretIds, NThreading::TPromise promise) : SecretIds(CreateSecretIds(ownerUserId, secretIds)) , Promise(promise) - , LastResponse(Ydb::StatusIds::TIMEOUT, { NYql::TIssue("secrets snapshot fetching timeout") }) - , MaximalSecretsSnapshotWaitTime(maximalSecretsSnapshotWaitTime) {} void Bootstrap() { @@ -67,20 +60,14 @@ class TDescribeSecretsActor: public NActors::TActorBootstrappedSend(NMetadata::NProvider::MakeServiceId(SelfId().NodeId()), new NMetadata::NProvider::TEvSubscribeExternal(GetSecretsSnapshotParser())); - this->Schedule(MaximalSecretsSnapshotWaitTime, new NActors::TEvents::TEvWakeup()); - } else { - this->Send(NMetadata::NProvider::MakeServiceId(SelfId().NodeId()), new NMetadata::NProvider::TEvAskSnapshot(GetSecretsSnapshotParser())); - SubscribedOnSecrets = false; - } + Send(NMetadata::NProvider::MakeServiceId(SelfId().NodeId()), new NMetadata::NProvider::TEvSubscribeExternal(GetSecretsSnapshotParser())); Become(&TDescribeSecretsActor::StateFunc); } private: static std::vector CreateSecretIds(const TString& ownerUserId, const std::vector& secretIds) { std::vector result; - for (const auto& secretId: secretIds) { + for (const TString& secretId : secretIds) { result.emplace_back(ownerUserId, secretId); } return result; @@ -89,32 +76,30 @@ class TDescribeSecretsActor: public NActors::TActorBootstrapped SecretIds; NThreading::TPromise Promise; - TEvDescribeSecretsResponse::TDescription LastResponse; - TDuration MaximalSecretsSnapshotWaitTime; - bool SubscribedOnSecrets = true; + bool AskSent = false; }; } // anonymous namespace -IActor* CreateDescribeSecretsActor(const TString& ownerUserId, const std::vector& secretIds, NThreading::TPromise promise, TDuration maximalSecretsSnapshotWaitTime) { - return new TDescribeSecretsActor(ownerUserId, secretIds, promise, maximalSecretsSnapshotWaitTime); +IActor* CreateDescribeSecretsActor(const TString& ownerUserId, const std::vector& secretIds, NThreading::TPromise promise) { + return new TDescribeSecretsActor(ownerUserId, secretIds, promise); } -void RegisterDescribeSecretsActor(const NActors::TActorId& replyActorId, const TString& ownerUserId, const std::vector& secretIds, NActors::TActorSystem* actorSystem, TDuration maximalSecretsSnapshotWaitTime) { +void RegisterDescribeSecretsActor(const NActors::TActorId& replyActorId, const TString& ownerUserId, const std::vector& secretIds, NActors::TActorSystem* actorSystem) { auto promise = NThreading::NewPromise(); - actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, secretIds, promise, maximalSecretsSnapshotWaitTime)); + actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, secretIds, promise)); promise.GetFuture().Subscribe([actorSystem, replyActorId](const NThreading::TFuture& result){ actorSystem->Send(replyActorId, new TEvDescribeSecretsResponse(result.GetValue())); }); } -NThreading::TFuture DescribeExternalDataSourceSecrets(const NKikimrSchemeOp::TAuth& authDescription, const TString& ownerUserId, TActorSystem* actorSystem, TDuration maximalSecretsSnapshotWaitTime) { +NThreading::TFuture DescribeExternalDataSourceSecrets(const NKikimrSchemeOp::TAuth& authDescription, const TString& ownerUserId, TActorSystem* actorSystem) { switch (authDescription.identity_case()) { case NKikimrSchemeOp::TAuth::kServiceAccount: { const TString& saSecretId = authDescription.GetServiceAccount().GetSecretName(); auto promise = NThreading::NewPromise(); - actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {saSecretId}, promise, maximalSecretsSnapshotWaitTime)); + actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {saSecretId}, promise)); return promise.GetFuture(); } @@ -124,7 +109,7 @@ NThreading::TFuture DescribeExternalDa case NKikimrSchemeOp::TAuth::kBasic: { const TString& passwordSecretId = authDescription.GetBasic().GetPasswordSecretName(); auto promise = NThreading::NewPromise(); - actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {passwordSecretId}, promise, maximalSecretsSnapshotWaitTime)); + actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {passwordSecretId}, promise)); return promise.GetFuture(); } @@ -132,7 +117,7 @@ NThreading::TFuture DescribeExternalDa const TString& saSecretId = authDescription.GetMdbBasic().GetServiceAccountSecretName(); const TString& passwordSecreId = authDescription.GetMdbBasic().GetPasswordSecretName(); auto promise = NThreading::NewPromise(); - actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {saSecretId, passwordSecreId}, promise, maximalSecretsSnapshotWaitTime)); + actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {saSecretId, passwordSecreId}, promise)); return promise.GetFuture(); } @@ -140,14 +125,14 @@ NThreading::TFuture DescribeExternalDa const TString& awsAccessKeyIdSecretId = authDescription.GetAws().GetAwsAccessKeyIdSecretName(); const TString& awsAccessKeyKeySecretId = authDescription.GetAws().GetAwsSecretAccessKeySecretName(); auto promise = NThreading::NewPromise(); - actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {awsAccessKeyIdSecretId, awsAccessKeyKeySecretId}, promise, maximalSecretsSnapshotWaitTime)); + actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {awsAccessKeyIdSecretId, awsAccessKeyKeySecretId}, promise)); return promise.GetFuture(); } case NKikimrSchemeOp::TAuth::kToken: { const TString& tokenSecretId = authDescription.GetToken().GetTokenSecretName(); auto promise = NThreading::NewPromise(); - actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {tokenSecretId}, promise, maximalSecretsSnapshotWaitTime)); + actorSystem->Register(CreateDescribeSecretsActor(ownerUserId, {tokenSecretId}, promise)); return promise.GetFuture(); } diff --git a/ydb/core/kqp/federated_query/kqp_federated_query_actors.h b/ydb/core/kqp/federated_query/kqp_federated_query_actors.h index 82a439527a07..3143eb9a610b 100644 --- a/ydb/core/kqp/federated_query/kqp_federated_query_actors.h +++ b/ydb/core/kqp/federated_query/kqp_federated_query_actors.h @@ -8,10 +8,10 @@ namespace NKikimr::NKqp { -IActor* CreateDescribeSecretsActor(const TString& ownerUserId, const std::vector& secretIds, NThreading::TPromise promise, TDuration maximalSecretsSnapshotWaitTime = TDuration::Zero()); +IActor* CreateDescribeSecretsActor(const TString& ownerUserId, const std::vector& secretIds, NThreading::TPromise promise); -void RegisterDescribeSecretsActor(const TActorId& replyActorId, const TString& ownerUserId, const std::vector& secretIds, TActorSystem* actorSystem, TDuration maximalSecretsSnapshotWaitTime = TDuration::Zero()); +void RegisterDescribeSecretsActor(const TActorId& replyActorId, const TString& ownerUserId, const std::vector& secretIds, TActorSystem* actorSystem); -NThreading::TFuture DescribeExternalDataSourceSecrets(const NKikimrSchemeOp::TAuth& authDescription, const TString& ownerUserId, TActorSystem* actorSystem, TDuration maximalSecretsSnapshotWaitTime = TDuration::Zero()); +NThreading::TFuture DescribeExternalDataSourceSecrets(const NKikimrSchemeOp::TAuth& authDescription, const TString& ownerUserId, TActorSystem* actorSystem); } // namespace NKikimr::NKqp diff --git a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.cpp b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.cpp index cf5e24ec12b5..6927cf0549d6 100644 --- a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.cpp +++ b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.cpp @@ -22,7 +22,6 @@ class TScriptFinalizerActor : public TActorBootstrapped { public: TScriptFinalizerActor(TEvScriptFinalizeRequest::TPtr request, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const std::optional& federatedQuerySetup, std::shared_ptr s3ActorsFactor) : ReplyActor(request->Sender) @@ -31,7 +30,6 @@ class TScriptFinalizerActor : public TActorBootstrapped { , FinalizationStatus(request->Get()->Description.FinalizationStatus) , Request(std::move(request)) , FinalizationTimeout(TDuration::Seconds(queryServiceConfig.GetFinalizeScriptServiceConfig().GetScriptFinalizationTimeoutSeconds())) - , MaximalSecretsSnapshotWaitTime(2 * TDuration::Seconds(metadataProviderConfig.GetRefreshPeriodSeconds())) , FederatedQuerySetup(federatedQuerySetup) , Compressor(queryServiceConfig.GetQueryArtifactsCompressionMethod(), queryServiceConfig.GetQueryArtifactsCompressionMinSize()) , S3ActorsFactor(std::move(s3ActorsFactor)) @@ -101,7 +99,7 @@ class TScriptFinalizerActor : public TActorBootstrapped { } void FetchSecrets() { - RegisterDescribeSecretsActor(SelfId(), UserToken, SecretNames, ActorContext().ActorSystem(), MaximalSecretsSnapshotWaitTime); + RegisterDescribeSecretsActor(SelfId(), UserToken, SecretNames, ActorContext().ActorSystem()); } void Handle(TEvDescribeSecretsResponse::TPtr& ev) { @@ -229,7 +227,6 @@ class TScriptFinalizerActor : public TActorBootstrapped { TEvScriptFinalizeRequest::TPtr Request; const TDuration FinalizationTimeout; - const TDuration MaximalSecretsSnapshotWaitTime; const std::optional& FederatedQuerySetup; const NFq::TCompressor Compressor; std::shared_ptr S3ActorsFactor; @@ -246,11 +243,10 @@ class TScriptFinalizerActor : public TActorBootstrapped { IActor* CreateScriptFinalizerActor(TEvScriptFinalizeRequest::TPtr request, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const std::optional& federatedQuerySetup, std::shared_ptr s3ActorsFactory ) { - return new TScriptFinalizerActor(std::move(request), queryServiceConfig, metadataProviderConfig, federatedQuerySetup, std::move(s3ActorsFactory)); + return new TScriptFinalizerActor(std::move(request), queryServiceConfig, federatedQuerySetup, std::move(s3ActorsFactory)); } } // namespace NKikimr::NKqp diff --git a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.h b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.h index 844187d87e2c..94d621acd482 100644 --- a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.h +++ b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_actor.h @@ -13,7 +13,6 @@ namespace NKikimr::NKqp { IActor* CreateScriptFinalizerActor(TEvScriptFinalizeRequest::TPtr request, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const std::optional& federatedQuerySetup, std::shared_ptr s3ActorsFactory); diff --git a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.cpp b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.cpp index 3a05ba257d21..e918e4202144 100644 --- a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.cpp +++ b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.cpp @@ -14,11 +14,9 @@ namespace { class TKqpFinalizeScriptService : public TActorBootstrapped { public: TKqpFinalizeScriptService(const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, IKqpFederatedQuerySetupFactory::TPtr federatedQuerySetupFactory, std::shared_ptr s3ActorsFactory) : QueryServiceConfig(queryServiceConfig) - , MetadataProviderConfig(metadataProviderConfig) , FederatedQuerySetupFactory(federatedQuerySetupFactory) , S3ActorsFactory(std::move(s3ActorsFactory)) {} @@ -83,7 +81,6 @@ class TKqpFinalizeScriptService : public TActorBootstrapped FederatedQuerySetup; @@ -142,10 +138,9 @@ class TKqpFinalizeScriptService : public TActorBootstrapped s3ActorsFactory) { - return new TKqpFinalizeScriptService(queryServiceConfig, metadataProviderConfig, std::move(federatedQuerySetupFactory), std::move(s3ActorsFactory)); + return new TKqpFinalizeScriptService(queryServiceConfig, std::move(federatedQuerySetupFactory), std::move(s3ActorsFactory)); } } // namespace NKikimr::NKqp diff --git a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.h b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.h index 44aa7fa5aa68..9ab926c1943f 100644 --- a/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.h +++ b/ydb/core/kqp/finalize_script_service/kqp_finalize_script_service.h @@ -11,7 +11,6 @@ namespace NKikimrConfig { namespace NKikimr::NKqp { IActor* CreateKqpFinalizeScriptService(const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, IKqpFederatedQuerySetupFactory::TPtr federatedQuerySetupFactory, std::shared_ptr s3ActorsFactory); diff --git a/ydb/core/kqp/gateway/kqp_metadata_loader.cpp b/ydb/core/kqp/gateway/kqp_metadata_loader.cpp index 9a4a9aaae4ed..86d8ef28d28f 100644 --- a/ydb/core/kqp/gateway/kqp_metadata_loader.cpp +++ b/ydb/core/kqp/gateway/kqp_metadata_loader.cpp @@ -468,9 +468,9 @@ void UpdateExternalDataSourceSecretsValue(TTableMetadataResult& externalDataSour } } -NThreading::TFuture LoadExternalDataSourceSecretValues(const NSchemeCache::TSchemeCacheNavigate::TEntry& entry, const TIntrusiveConstPtr& userToken, TDuration maximalSecretsSnapshotWaitTime, TActorSystem* actorSystem) { +NThreading::TFuture LoadExternalDataSourceSecretValues(const NSchemeCache::TSchemeCacheNavigate::TEntry& entry, const TIntrusiveConstPtr& userToken, TActorSystem* actorSystem) { const auto& authDescription = entry.ExternalDataSourceInfo->Description.GetAuth(); - return DescribeExternalDataSourceSecrets(authDescription, userToken ? userToken->GetUserSID() : "", actorSystem, maximalSecretsSnapshotWaitTime); + return DescribeExternalDataSourceSecrets(authDescription, userToken ? userToken->GetUserSID() : "", actorSystem); } } // anonymous namespace @@ -838,7 +838,7 @@ NThreading::TFuture TKqpTableMetadataLoader::LoadTableMeta promise.SetValue(externalDataSourceMetadata); return; } - LoadExternalDataSourceSecretValues(entry, userToken, MaximalSecretsSnapshotWaitTime, ActorSystem) + LoadExternalDataSourceSecretValues(entry, userToken, ActorSystem) .Subscribe([promise, externalDataSourceMetadata, settings](const TFuture& result) mutable { UpdateExternalDataSourceSecretsValue(externalDataSourceMetadata, result.GetValue()); diff --git a/ydb/core/kqp/gateway/kqp_metadata_loader.h b/ydb/core/kqp/gateway/kqp_metadata_loader.h index 6cb0ff907413..ca7908164767 100644 --- a/ydb/core/kqp/gateway/kqp_metadata_loader.h +++ b/ydb/core/kqp/gateway/kqp_metadata_loader.h @@ -23,14 +23,12 @@ class TKqpTableMetadataLoader : public NYql::IKikimrGateway::IKqpTableMetadataLo TActorSystem* actorSystem, NYql::TKikimrConfiguration::TPtr config, bool needCollectSchemeData = false, - TKqpTempTablesState::TConstPtr tempTablesState = nullptr, - TDuration maximalSecretsSnapshotWaitTime = TDuration::Seconds(20)) + TKqpTempTablesState::TConstPtr tempTablesState = nullptr) : Cluster(cluster) , NeedCollectSchemeData(needCollectSchemeData) , ActorSystem(actorSystem) , Config(config) , TempTablesState(std::move(tempTablesState)) - , MaximalSecretsSnapshotWaitTime(maximalSecretsSnapshotWaitTime) {} NThreading::TFuture LoadTableMetadata( @@ -70,7 +68,6 @@ class TKqpTableMetadataLoader : public NYql::IKikimrGateway::IKqpTableMetadataLo TActorSystem* ActorSystem; NYql::TKikimrConfiguration::TPtr Config; TKqpTempTablesState::TConstPtr TempTablesState; - TDuration MaximalSecretsSnapshotWaitTime; }; } // namespace NKikimr::NKqp diff --git a/ydb/core/kqp/proxy_service/kqp_proxy_service.cpp b/ydb/core/kqp/proxy_service/kqp_proxy_service.cpp index 7406b105a5ba..619cf7b1e210 100644 --- a/ydb/core/kqp/proxy_service/kqp_proxy_service.cpp +++ b/ydb/core/kqp/proxy_service/kqp_proxy_service.cpp @@ -178,7 +178,6 @@ class TKqpProxyService : public TActorBootstrapped { TKqpProxyService(const NKikimrConfig::TLogConfig& logConfig, const NKikimrConfig::TTableServiceConfig& tableServiceConfig, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, TVector&& settings, std::shared_ptr queryReplayFactory, std::shared_ptr&& kqpProxySharedResources, @@ -187,7 +186,6 @@ class TKqpProxyService : public TActorBootstrapped { ): LogConfig(logConfig) , TableServiceConfig(tableServiceConfig) , QueryServiceConfig(queryServiceConfig) - , MetadataProviderConfig(metadataProviderConfig) , KqpSettings(std::make_shared(std::move(settings))) , FederatedQuerySetupFactory(federatedQuerySetupFactory) , QueryReplayFactory(std::move(queryReplayFactory)) @@ -253,7 +251,7 @@ class TKqpProxyService : public TActorBootstrapped { } // Create compile service - CompileService = TlsActivationContext->ExecutorThread.RegisterActor(CreateKqpCompileService(TableServiceConfig, QueryServiceConfig, MetadataProviderConfig, + CompileService = TlsActivationContext->ExecutorThread.RegisterActor(CreateKqpCompileService(TableServiceConfig, QueryServiceConfig, KqpSettings, ModuleResolverState, Counters, std::move(QueryReplayFactory), FederatedQuerySetup)); TlsActivationContext->ExecutorThread.ActorSystem->RegisterLocalService( MakeKqpCompileServiceID(SelfId().NodeId()), CompileService); @@ -1463,7 +1461,7 @@ class TKqpProxyService : public TActorBootstrapped { IActor* sessionActor = CreateKqpSessionActor(SelfId(), sessionId, KqpSettings, workerSettings, FederatedQuerySetup, AsyncIoFactory, ModuleResolverState, Counters, - QueryServiceConfig, MetadataProviderConfig, KqpTempTablesAgentActor); + QueryServiceConfig, KqpTempTablesAgentActor); auto workerId = TlsActivationContext->ExecutorThread.RegisterActor(sessionActor, TMailboxType::HTSwap, AppData()->UserPoolId); TKqpSessionInfo* sessionInfo = LocalSessions->Create( sessionId, workerId, database, dbCounters, supportsBalancing, GetSessionIdleDuration(), pgWire); @@ -1737,7 +1735,6 @@ class TKqpProxyService : public TActorBootstrapped { NKikimrConfig::TLogConfig LogConfig; NKikimrConfig::TTableServiceConfig TableServiceConfig; NKikimrConfig::TQueryServiceConfig QueryServiceConfig; - NKikimrConfig::TMetadataProviderConfig MetadataProviderConfig; TKqpSettings::TConstPtr KqpSettings; IKqpFederatedQuerySetupFactory::TPtr FederatedQuerySetupFactory; std::optional FederatedQuerySetup; @@ -1798,7 +1795,6 @@ class TKqpProxyService : public TActorBootstrapped { IActor* CreateKqpProxyService(const NKikimrConfig::TLogConfig& logConfig, const NKikimrConfig::TTableServiceConfig& tableServiceConfig, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, TVector&& settings, std::shared_ptr queryReplayFactory, std::shared_ptr kqpProxySharedResources, @@ -1806,7 +1802,7 @@ IActor* CreateKqpProxyService(const NKikimrConfig::TLogConfig& logConfig, std::shared_ptr s3ActorsFactory ) { - return new TKqpProxyService(logConfig, tableServiceConfig, queryServiceConfig, metadataProviderConfig, std::move(settings), + return new TKqpProxyService(logConfig, tableServiceConfig, queryServiceConfig, std::move(settings), std::move(queryReplayFactory), std::move(kqpProxySharedResources), std::move(federatedQuerySetupFactory), std::move(s3ActorsFactory)); } diff --git a/ydb/core/kqp/proxy_service/kqp_proxy_service.h b/ydb/core/kqp/proxy_service/kqp_proxy_service.h index ec4204c01ff0..8ad30a2d0061 100644 --- a/ydb/core/kqp/proxy_service/kqp_proxy_service.h +++ b/ydb/core/kqp/proxy_service/kqp_proxy_service.h @@ -63,8 +63,7 @@ TPeerStats CalcPeerStats(const TVector& data IActor* CreateKqpProxyService(const NKikimrConfig::TLogConfig& logConfig, const NKikimrConfig::TTableServiceConfig& tableServiceConfig, - const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, + const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, TVector&& settings, std::shared_ptr queryReplayFactory, std::shared_ptr kqpProxySharedResources, diff --git a/ydb/core/kqp/session_actor/kqp_session_actor.cpp b/ydb/core/kqp/session_actor/kqp_session_actor.cpp index ed8edc9bcd1e..fe631799ce47 100644 --- a/ydb/core/kqp/session_actor/kqp_session_actor.cpp +++ b/ydb/core/kqp/session_actor/kqp_session_actor.cpp @@ -159,7 +159,6 @@ class TKqpSessionActor : public TActorBootstrapped { NYql::NDq::IDqAsyncIoFactory::TPtr asyncIoFactory, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const TActorId& kqpTempTablesAgentActor) : Owner(owner) , SessionId(sessionId) @@ -172,7 +171,6 @@ class TKqpSessionActor : public TActorBootstrapped { , Config(CreateConfig(kqpSettings, workerSettings)) , Transactions(*Config->_KqpMaxActiveTxPerSession.Get(), TDuration::Seconds(*Config->_KqpTxIdleTimeoutSec.Get())) , QueryServiceConfig(queryServiceConfig) - , MetadataProviderConfig(metadataProviderConfig) , KqpTempTablesAgentActor(kqpTempTablesAgentActor) , GUCSettings(std::make_shared()) { @@ -234,7 +232,7 @@ class TKqpSessionActor : public TActorBootstrapped { void ForwardRequest(TEvKqp::TEvQueryRequest::TPtr& ev) { if (!WorkerId) { std::unique_ptr workerActor(CreateKqpWorkerActor(SelfId(), SessionId, KqpSettings, Settings, - FederatedQuerySetup, ModuleResolverState, Counters, QueryServiceConfig, MetadataProviderConfig, GUCSettings)); + FederatedQuerySetup, ModuleResolverState, Counters, QueryServiceConfig, GUCSettings)); WorkerId = RegisterWithSameMailbox(workerActor.release()); } TlsActivationContext->Send(new IEventHandle(*WorkerId, SelfId(), QueryState->RequestEv.release(), ev->Flags, ev->Cookie, @@ -1218,7 +1216,7 @@ class TKqpSessionActor : public TActorBootstrapped { auto executerActor = CreateKqpExecuter(std::move(request), Settings.Database, QueryState ? QueryState->UserToken : TIntrusiveConstPtr(), RequestCounters, Settings.TableService.GetAggregationConfig(), Settings.TableService.GetExecuterRetriesConfig(), - AsyncIoFactory, QueryState ? QueryState->PreparedQuery : nullptr, Settings.TableService.GetChannelTransportVersion(), SelfId(), 2 * TDuration::Seconds(MetadataProviderConfig.GetRefreshPeriodSeconds()), + AsyncIoFactory, QueryState ? QueryState->PreparedQuery : nullptr, Settings.TableService.GetChannelTransportVersion(), SelfId(), QueryState ? QueryState->UserRequestContext : MakeIntrusive("", Settings.Database, SessionId), Settings.TableService.GetEnableOlapSink(), useEvWrite, QueryState ? QueryState->StatementResultIndex : 0, FederatedQuerySetup, GUCSettings); @@ -2428,7 +2426,6 @@ class TKqpSessionActor : public TActorBootstrapped { TKqpTempTablesState TempTablesState; NKikimrConfig::TQueryServiceConfig QueryServiceConfig; - NKikimrConfig::TMetadataProviderConfig MetadataProviderConfig; TActorId KqpTempTablesAgentActor; std::shared_ptr> CompilationCookie; @@ -2446,12 +2443,11 @@ IActor* CreateKqpSessionActor(const TActorId& owner, const TString& sessionId, NYql::NDq::IDqAsyncIoFactory::TPtr asyncIoFactory, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const TActorId& kqpTempTablesAgentActor) { return new TKqpSessionActor(owner, sessionId, kqpSettings, workerSettings, federatedQuerySetup, std::move(asyncIoFactory), std::move(moduleResolverState), counters, - queryServiceConfig, metadataProviderConfig, kqpTempTablesAgentActor); + queryServiceConfig, kqpTempTablesAgentActor); } } diff --git a/ydb/core/kqp/session_actor/kqp_session_actor.h b/ydb/core/kqp/session_actor/kqp_session_actor.h index 74a4c987c5c0..e931fb11935e 100644 --- a/ydb/core/kqp/session_actor/kqp_session_actor.h +++ b/ydb/core/kqp/session_actor/kqp_session_actor.h @@ -54,7 +54,6 @@ IActor* CreateKqpSessionActor(const TActorId& owner, const TString& sessionId, NYql::NDq::IDqAsyncIoFactory::TPtr asyncIoFactory, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const TActorId& kqpTempTablesAgentActor); IActor* CreateKqpTempTablesManager( diff --git a/ydb/core/kqp/session_actor/kqp_worker_actor.cpp b/ydb/core/kqp/session_actor/kqp_worker_actor.cpp index 71ea92dc1482..870ffa599ff7 100644 --- a/ydb/core/kqp/session_actor/kqp_worker_actor.cpp +++ b/ydb/core/kqp/session_actor/kqp_worker_actor.cpp @@ -99,8 +99,7 @@ class TKqpWorkerActor : public TActorBootstrapped { TKqpWorkerActor(const TActorId& owner, const TString& sessionId, const TKqpSettings::TConstPtr& kqpSettings, const TKqpWorkerSettings& workerSettings, std::optional federatedQuerySetup, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, - const TQueryServiceConfig& queryServiceConfig, const TMetadataProviderConfig& metadataProviderConfig, - const TGUCSettings::TPtr& gUCSettings + const TQueryServiceConfig& queryServiceConfig, const TGUCSettings::TPtr& gUCSettings ) : Owner(owner) , SessionId(sessionId) @@ -110,7 +109,6 @@ class TKqpWorkerActor : public TActorBootstrapped { , Counters(counters) , Config(MakeIntrusive()) , QueryServiceConfig(queryServiceConfig) - , MetadataProviderConfig(metadataProviderConfig) , CreationTime(TInstant::Now()) , QueryId(0) , ShutdownState(std::nullopt) @@ -183,7 +181,7 @@ class TKqpWorkerActor : public TActorBootstrapped { QueryState->RequestEv.reset(ev->Release().Release()); std::shared_ptr loader = std::make_shared( - Settings.Cluster, TlsActivationContext->ActorSystem(), Config, false, nullptr, 2 * TDuration::Seconds(MetadataProviderConfig.GetRefreshPeriodSeconds())); + Settings.Cluster, TlsActivationContext->ActorSystem(), Config, false, nullptr); Gateway = CreateKikimrIcGateway(Settings.Cluster, QueryState->RequestEv->GetType(), Settings.Database, std::move(loader), ctx.ExecutorThread.ActorSystem, ctx.SelfID.NodeId(), RequestCounters, QueryServiceConfig); @@ -1085,7 +1083,6 @@ class TKqpWorkerActor : public TActorBootstrapped { TIntrusivePtr RequestCounters; TKikimrConfiguration::TPtr Config; TQueryServiceConfig QueryServiceConfig; - TMetadataProviderConfig MetadataProviderConfig; TInstant CreationTime; TIntrusivePtr Gateway; TIntrusivePtr KqpHost; @@ -1102,12 +1099,11 @@ IActor* CreateKqpWorkerActor(const TActorId& owner, const TString& sessionId, const TKqpSettings::TConstPtr& kqpSettings, const TKqpWorkerSettings& workerSettings, std::optional federatedQuerySetup, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, - const TQueryServiceConfig& queryServiceConfig, const TMetadataProviderConfig& metadataProviderConfig, - const TGUCSettings::TPtr& gUCSettings + const TQueryServiceConfig& queryServiceConfig, const TGUCSettings::TPtr& gUCSettings ) { return new TKqpWorkerActor(owner, sessionId, kqpSettings, workerSettings, federatedQuerySetup, - moduleResolverState, counters, queryServiceConfig, metadataProviderConfig, gUCSettings); + moduleResolverState, counters, queryServiceConfig, gUCSettings); } } // namespace NKqp diff --git a/ydb/core/kqp/session_actor/kqp_worker_common.h b/ydb/core/kqp/session_actor/kqp_worker_common.h index 8f8128fa596b..59ef798e8c00 100644 --- a/ydb/core/kqp/session_actor/kqp_worker_common.h +++ b/ydb/core/kqp/session_actor/kqp_worker_common.h @@ -149,7 +149,6 @@ IActor* CreateKqpWorkerActor(const TActorId& owner, const TString& sessionId, TIntrusivePtr moduleResolverState, TIntrusivePtr counters, const NKikimrConfig::TQueryServiceConfig& queryServiceConfig, - const NKikimrConfig::TMetadataProviderConfig& metadataProviderConfig, const TGUCSettings::TPtr& gUCSettings ); diff --git a/ydb/core/testlib/test_client.cpp b/ydb/core/testlib/test_client.cpp index 79105fd14889..e23e7f19e2fb 100644 --- a/ydb/core/testlib/test_client.cpp +++ b/ydb/core/testlib/test_client.cpp @@ -888,7 +888,6 @@ namespace Tests { IActor* kqpProxyService = NKqp::CreateKqpProxyService(Settings->AppConfig->GetLogConfig(), Settings->AppConfig->GetTableServiceConfig(), Settings->AppConfig->GetQueryServiceConfig(), - Settings->AppConfig->GetMetadataProviderConfig(), TVector(Settings->KqpSettings), nullptr, std::move(kqpProxySharedResources), federatedQuerySetupFactory, Settings->S3ActorsFactory); @@ -896,7 +895,7 @@ namespace Tests { Runtime->RegisterService(NKqp::MakeKqpProxyID(Runtime->GetNodeId(nodeIdx)), kqpProxyServiceId, nodeIdx); IActor* scriptFinalizeService = NKqp::CreateKqpFinalizeScriptService( - Settings->AppConfig->GetQueryServiceConfig(), Settings->AppConfig->GetMetadataProviderConfig(), federatedQuerySetupFactory, Settings->S3ActorsFactory + Settings->AppConfig->GetQueryServiceConfig(), federatedQuerySetupFactory, Settings->S3ActorsFactory ); TActorId scriptFinalizeServiceId = Runtime->Register(scriptFinalizeService, nodeIdx); Runtime->RegisterService(NKqp::MakeKqpFinalizeScriptServiceId(Runtime->GetNodeId(nodeIdx)), scriptFinalizeServiceId, nodeIdx);