aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivanmorozov <ivanmorozov@yandex-team.com>2022-12-07 15:30:36 +0300
committerivanmorozov <ivanmorozov@yandex-team.com>2022-12-07 15:30:36 +0300
commit0554cbf9545cfeb4f4304e9adaccedef03386234 (patch)
tree4bfa7b4d169a7f3d76fa674d76522267c64b77e2
parent0c53a38909eec7c5872384fa373409c8a9ecd681 (diff)
downloadydb-0554cbf9545cfeb4f4304e9adaccedef03386234.tar.gz
manager preparation for schema initialization only
-rw-r--r--ydb/services/metadata/abstract/common.h2
-rw-r--r--ydb/services/metadata/abstract/kqp_common.h7
-rw-r--r--ydb/services/metadata/ds_table/service.cpp13
-rw-r--r--ydb/services/metadata/ds_table/service.h2
-rw-r--r--ydb/services/metadata/initializer/CMakeLists.txt1
-rw-r--r--ydb/services/metadata/initializer/ut/CMakeLists.darwin.txt52
-rw-r--r--ydb/services/metadata/initializer/ut/CMakeLists.linux-aarch64.txt54
-rw-r--r--ydb/services/metadata/initializer/ut/CMakeLists.linux.txt56
-rw-r--r--ydb/services/metadata/initializer/ut/CMakeLists.txt15
-rw-r--r--ydb/services/metadata/initializer/ut/ut_init.cpp137
-rw-r--r--ydb/services/metadata/manager/CMakeLists.txt1
-rw-r--r--ydb/services/metadata/manager/generic_manager.cpp2
-rw-r--r--ydb/services/metadata/manager/init_manager.cpp32
-rw-r--r--ydb/services/metadata/manager/init_manager.h28
-rw-r--r--ydb/services/metadata/secret/ut/CMakeLists.darwin.txt6
-rw-r--r--ydb/services/metadata/secret/ut/CMakeLists.linux-aarch64.txt6
-rw-r--r--ydb/services/metadata/secret/ut/CMakeLists.linux.txt6
-rw-r--r--ydb/services/metadata/service.h20
18 files changed, 425 insertions, 15 deletions
diff --git a/ydb/services/metadata/abstract/common.h b/ydb/services/metadata/abstract/common.h
index 4c53aa7c48..c60a105a6f 100644
--- a/ydb/services/metadata/abstract/common.h
+++ b/ydb/services/metadata/abstract/common.h
@@ -26,6 +26,8 @@ enum EEvSubscribe {
EvUnsubscribeExternal,
EvYQLResponse,
EvAlterObjects,
+ EvPrepareManager,
+ EvManagerPrepared,
EvEnd
};
diff --git a/ydb/services/metadata/abstract/kqp_common.h b/ydb/services/metadata/abstract/kqp_common.h
index 13e1e8f42b..5bc862fd80 100644
--- a/ydb/services/metadata/abstract/kqp_common.h
+++ b/ydb/services/metadata/abstract/kqp_common.h
@@ -88,6 +88,8 @@ public:
public:
TModificationContext() = default;
};
+private:
+ mutable std::shared_ptr<IInitializationBehaviour> InitializationBehaviour;
protected:
virtual NThreading::TFuture<TObjectOperatorResult> DoCreateObject(const NYql::TCreateObjectSettings& settings, const ui32 nodeId,
IOperationsManager::TPtr manager, const TModificationContext& context) const = 0;
@@ -114,7 +116,10 @@ public:
}
std::shared_ptr<IInitializationBehaviour> GetInitializationBehaviour() const {
- return DoGetInitializationBehaviour();
+ if (!InitializationBehaviour) {
+ InitializationBehaviour = DoGetInitializationBehaviour();
+ }
+ return InitializationBehaviour;
}
virtual TString GetTypeId() const = 0;
virtual TString GetTablePath() const = 0;
diff --git a/ydb/services/metadata/ds_table/service.cpp b/ydb/services/metadata/ds_table/service.cpp
index a1136b688e..74f4b75931 100644
--- a/ydb/services/metadata/ds_table/service.cpp
+++ b/ydb/services/metadata/ds_table/service.cpp
@@ -34,6 +34,16 @@ void TService::PrepareManagers(std::vector<NMetadata::IOperationsManager::TPtr>
EventsWaiting[id].emplace_back(ev, sender);
}
+void TService::Handle(TEvPrepareManager::TPtr& ev) {
+ auto it = RegisteredManagers.find(ev->Get()->GetManager()->GetTypeId());
+ if (it != RegisteredManagers.end()) {
+ Send(ev->Sender, new TEvManagerPrepared(ev->Get()->GetManager()));
+ } else {
+ auto m = ev->Get()->GetManager();
+ PrepareManagers({ m }, ev->ReleaseBase(), ev->Sender);
+ }
+}
+
void TService::Handle(NMetadataInitializer::TEvInitializationFinished::TPtr& ev) {
const TString& initId = ev->Get()->GetInitializationId();
@@ -69,6 +79,7 @@ void TService::Handle(NMetadataInitializer::TEvInitializationFinished::TPtr& ev)
EventsWaiting.emplace(i.first, std::move(i.second));
}
}
+
void TService::Handle(TEvSubscribeExternal::TPtr& ev) {
const TActorId senderId = ev->Sender;
ProcessEventWithFetcher(ev, [this, senderId](const TActorId& actorId) {
@@ -114,7 +125,7 @@ void TService::Handle(TEvRefreshSubscriberData::TPtr& ev) {
}
void TService::Bootstrap(const NActors::TActorContext& /*ctx*/) {
- ALS_INFO(0) << "metadata service started" << Endl;
+ ALS_INFO(NKikimrServices::METADATA_PROVIDER) << "metadata service started" << Endl;
Become(&TService::StateMain);
InternalController = std::make_shared<TServiceInternalController>(SelfId());
}
diff --git a/ydb/services/metadata/ds_table/service.h b/ydb/services/metadata/ds_table/service.h
index 11e7fd891f..5c71a2229b 100644
--- a/ydb/services/metadata/ds_table/service.h
+++ b/ydb/services/metadata/ds_table/service.h
@@ -108,6 +108,7 @@ private:
void Handle(NMetadataInitializer::TEvInitializationFinished::TPtr& ev);
void Handle(TEvRefreshSubscriberData::TPtr& ev);
void Handle(TEvAskSnapshot::TPtr& ev);
+ void Handle(TEvPrepareManager::TPtr& ev);
void Handle(TEvSubscribeExternal::TPtr& ev);
void Handle(TEvUnsubscribeExternal::TPtr& ev);
void Handle(TEvObjectsOperation::TPtr& ev);
@@ -142,6 +143,7 @@ public:
hFunc(TEvObjectsOperation, Handle);
hFunc(TEvRefreshSubscriberData, Handle);
hFunc(TEvAskSnapshot, Handle);
+ hFunc(TEvPrepareManager, Handle);
hFunc(TEvSubscribeExternal, Handle);
hFunc(TEvUnsubscribeExternal, Handle);
hFunc(NMetadataInitializer::TEvInitializationFinished, Handle);
diff --git a/ydb/services/metadata/initializer/CMakeLists.txt b/ydb/services/metadata/initializer/CMakeLists.txt
index 7abe0ee5bf..cb54360903 100644
--- a/ydb/services/metadata/initializer/CMakeLists.txt
+++ b/ydb/services/metadata/initializer/CMakeLists.txt
@@ -6,6 +6,7 @@
# original buildsystem will not be accepted.
+add_subdirectory(ut)
add_library(services-metadata-initializer)
target_link_libraries(services-metadata-initializer PUBLIC
diff --git a/ydb/services/metadata/initializer/ut/CMakeLists.darwin.txt b/ydb/services/metadata/initializer/ut/CMakeLists.darwin.txt
new file mode 100644
index 0000000000..38930a3f12
--- /dev/null
+++ b/ydb/services/metadata/initializer/ut/CMakeLists.darwin.txt
@@ -0,0 +1,52 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_executable(ydb-services-metadata-initializer-ut)
+target_compile_options(ydb-services-metadata-initializer-ut PRIVATE
+ -DUSE_CURRENT_UDF_ABI_VERSION
+)
+target_include_directories(ydb-services-metadata-initializer-ut PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/initializer
+)
+target_link_libraries(ydb-services-metadata-initializer-ut PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ library-cpp-cpuid_check
+ cpp-testing-unittest_main
+ services-metadata-initializer
+ library-cpp-getopt
+ cpp-regex-pcre
+ library-cpp-svnversion
+ core-testlib-default
+ ydb-services-metadata
+ public-lib-yson_value
+)
+target_link_options(ydb-services-metadata-initializer-ut PRIVATE
+ -Wl,-no_deduplicate
+ -Wl,-sdk_version,10.15
+ -fPIC
+ -fPIC
+ -framework
+ CoreFoundation
+)
+target_sources(ydb-services-metadata-initializer-ut PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/initializer/ut/ut_init.cpp
+)
+add_test(
+ NAME
+ ydb-services-metadata-initializer-ut
+ COMMAND
+ ydb-services-metadata-initializer-ut
+ --print-before-suite
+ --print-before-test
+ --fork-tests
+ --print-times
+ --show-fails
+)
+vcs_info(ydb-services-metadata-initializer-ut)
diff --git a/ydb/services/metadata/initializer/ut/CMakeLists.linux-aarch64.txt b/ydb/services/metadata/initializer/ut/CMakeLists.linux-aarch64.txt
new file mode 100644
index 0000000000..8fc11e6dd0
--- /dev/null
+++ b/ydb/services/metadata/initializer/ut/CMakeLists.linux-aarch64.txt
@@ -0,0 +1,54 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_executable(ydb-services-metadata-initializer-ut)
+target_compile_options(ydb-services-metadata-initializer-ut PRIVATE
+ -DUSE_CURRENT_UDF_ABI_VERSION
+)
+target_include_directories(ydb-services-metadata-initializer-ut PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/initializer
+)
+target_link_libraries(ydb-services-metadata-initializer-ut PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ library-cpp-lfalloc
+ cpp-testing-unittest_main
+ services-metadata-initializer
+ library-cpp-getopt
+ cpp-regex-pcre
+ library-cpp-svnversion
+ core-testlib-default
+ ydb-services-metadata
+ public-lib-yson_value
+)
+target_link_options(ydb-services-metadata-initializer-ut PRIVATE
+ -ldl
+ -lrt
+ -Wl,--no-as-needed
+ -fPIC
+ -fPIC
+ -lpthread
+ -lrt
+ -ldl
+)
+target_sources(ydb-services-metadata-initializer-ut PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/initializer/ut/ut_init.cpp
+)
+add_test(
+ NAME
+ ydb-services-metadata-initializer-ut
+ COMMAND
+ ydb-services-metadata-initializer-ut
+ --print-before-suite
+ --print-before-test
+ --fork-tests
+ --print-times
+ --show-fails
+)
+vcs_info(ydb-services-metadata-initializer-ut)
diff --git a/ydb/services/metadata/initializer/ut/CMakeLists.linux.txt b/ydb/services/metadata/initializer/ut/CMakeLists.linux.txt
new file mode 100644
index 0000000000..e485d5c4ec
--- /dev/null
+++ b/ydb/services/metadata/initializer/ut/CMakeLists.linux.txt
@@ -0,0 +1,56 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_executable(ydb-services-metadata-initializer-ut)
+target_compile_options(ydb-services-metadata-initializer-ut PRIVATE
+ -DUSE_CURRENT_UDF_ABI_VERSION
+)
+target_include_directories(ydb-services-metadata-initializer-ut PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/initializer
+)
+target_link_libraries(ydb-services-metadata-initializer-ut PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ cpp-malloc-tcmalloc
+ libs-tcmalloc-no_percpu_cache
+ library-cpp-cpuid_check
+ cpp-testing-unittest_main
+ services-metadata-initializer
+ library-cpp-getopt
+ cpp-regex-pcre
+ library-cpp-svnversion
+ core-testlib-default
+ ydb-services-metadata
+ public-lib-yson_value
+)
+target_link_options(ydb-services-metadata-initializer-ut PRIVATE
+ -ldl
+ -lrt
+ -Wl,--no-as-needed
+ -fPIC
+ -fPIC
+ -lpthread
+ -lrt
+ -ldl
+)
+target_sources(ydb-services-metadata-initializer-ut PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/initializer/ut/ut_init.cpp
+)
+add_test(
+ NAME
+ ydb-services-metadata-initializer-ut
+ COMMAND
+ ydb-services-metadata-initializer-ut
+ --print-before-suite
+ --print-before-test
+ --fork-tests
+ --print-times
+ --show-fails
+)
+vcs_info(ydb-services-metadata-initializer-ut)
diff --git a/ydb/services/metadata/initializer/ut/CMakeLists.txt b/ydb/services/metadata/initializer/ut/CMakeLists.txt
new file mode 100644
index 0000000000..3e0811fb22
--- /dev/null
+++ b/ydb/services/metadata/initializer/ut/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND UNIX AND NOT APPLE AND NOT ANDROID)
+ include(CMakeLists.linux-aarch64.txt)
+elseif (APPLE)
+ include(CMakeLists.darwin.txt)
+elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND UNIX AND NOT APPLE AND NOT ANDROID)
+ include(CMakeLists.linux.txt)
+endif()
diff --git a/ydb/services/metadata/initializer/ut/ut_init.cpp b/ydb/services/metadata/initializer/ut/ut_init.cpp
new file mode 100644
index 0000000000..f0596d87f8
--- /dev/null
+++ b/ydb/services/metadata/initializer/ut/ut_init.cpp
@@ -0,0 +1,137 @@
+#include <ydb/core/cms/console/configs_dispatcher.h>
+#include <ydb/core/testlib/cs_helper.h>
+#include <ydb/core/tx/tiering/external_data.h>
+#include <ydb/core/tx/schemeshard/schemeshard.h>
+#include <ydb/core/tx/tx_proxy/proxy.h>
+#include <ydb/core/wrappers/ut_helpers/s3_mock.h>
+#include <ydb/core/wrappers/s3_wrapper.h>
+#include <ydb/core/wrappers/fake_storage.h>
+#include <ydb/library/accessor/accessor.h>
+#include <ydb/public/sdk/cpp/client/ydb_table/table.h>
+#include <ydb/services/metadata/abstract/common.h>
+#include <ydb/services/metadata/initializer/initializer.h>
+#include <ydb/services/metadata/manager/alter.h>
+#include <ydb/services/metadata/manager/common.h>
+#include <ydb/services/metadata/manager/init_manager.h>
+#include <ydb/services/metadata/manager/table_record.h>
+#include <ydb/services/metadata/manager/ydb_value_operator.h>
+#include <ydb/services/metadata/secret/manager.h>
+#include <ydb/services/metadata/secret/fetcher.h>
+#include <ydb/services/metadata/secret/snapshot.h>
+#include <ydb/services/metadata/service.h>
+
+#include <library/cpp/actors/core/av_bootstrapped.h>
+#include <library/cpp/protobuf/json/proto2json.h>
+#include <library/cpp/testing/unittest/registar.h>
+
+#include <util/system/hostname.h>
+#include <util/system/type_name.h>
+
+namespace NKikimr {
+
+using namespace NColumnShard;
+
+Y_UNIT_TEST_SUITE(Initializer) {
+
+ class TTestInitializer: public NMetadata::IInitializationBehaviour {
+ protected:
+ virtual void DoPrepare(NMetadataInitializer::IInitializerInput::TPtr controller) const override {
+ TVector<NMetadataInitializer::ITableModifier::TPtr> result;
+ const TString tablePath = "/Root/.metadata/test";
+ {
+ Ydb::Table::CreateTableRequest request;
+ request.set_session_id("");
+ request.set_path(tablePath);
+ request.add_primary_key("test");
+ {
+ auto& column = *request.add_columns();
+ column.set_name("test");
+ column.mutable_type()->mutable_optional_type()->mutable_item()->set_type_id(Ydb::Type::STRING);
+ }
+ result.emplace_back(new NMetadataInitializer::TGenericTableModifier<NInternal::NRequest::TDialogCreateTable>(request, "create"));
+ }
+ result.emplace_back(NMetadataInitializer::TACLModifierConstructor::GetReadOnlyModifier(tablePath, "acl"));
+ controller->PreparationFinished(result);
+ }
+ public:
+ };
+
+ class TInitManagerTest: public NMetadata::TInitManagerBase {
+ protected:
+ virtual std::shared_ptr<NMetadata::IInitializationBehaviour> DoGetInitializationBehaviour() const override {
+ return std::make_shared<TTestInitializer>();
+ }
+ public:
+ virtual TString GetTypeId() const override {
+ return TypeName<TInitManagerTest>();
+ }
+ };
+
+ class TInitUserEmulator: public NActors::TActorBootstrapped<TInitUserEmulator> {
+ private:
+ using TBase = NActors::TActorBootstrapped<TInitUserEmulator>;
+ std::shared_ptr<TInitManagerTest> Manager = std::make_shared<TInitManagerTest>();
+ YDB_READONLY_FLAG(Initialized, false);
+ public:
+
+ STATEFN(StateWork) {
+ switch (ev->GetTypeRewrite()) {
+ hFunc(NMetadataProvider::TEvManagerPrepared, Handle);
+ default:
+ Y_VERIFY(false);
+ }
+ }
+
+ void Handle(NMetadataProvider::TEvManagerPrepared::TPtr& /*ev*/) {
+ InitializedFlag = true;
+ }
+
+ void Bootstrap() {
+ Become(&TThis::StateWork);
+ Sender<NMetadataProvider::TEvPrepareManager>(Manager).SendTo(NMetadataProvider::MakeServiceId(SelfId().NodeId()));
+ }
+ };
+
+ Y_UNIT_TEST(Simple) {
+ TPortManager pm;
+
+ ui32 grpcPort = pm.GetPort();
+ ui32 msgbPort = pm.GetPort();
+
+ Tests::TServerSettings serverSettings(msgbPort);
+ serverSettings.Port = msgbPort;
+ serverSettings.GrpcPort = grpcPort;
+ serverSettings.SetDomainName("Root")
+ .SetUseRealThreads(false)
+ .SetEnableMetadataProvider(true)
+ .SetEnableOlapSchemaOperations(true);
+ ;
+
+ Tests::TServer::TPtr server = new Tests::TServer(serverSettings);
+ server->EnableGRpc(grpcPort);
+
+ Tests::TClient client(serverSettings);
+
+ auto& runtime = *server->GetRuntime();
+
+ auto sender = runtime.AllocateEdgeActor();
+ server->SetupRootStoragePools(sender);
+
+ Tests::NCS::THelper lHelper(*server);
+ lHelper.StartDataRequest("SELECT * FROM `/Root/.metadata/test`", false);
+
+ TInitUserEmulator* emulator = new TInitUserEmulator;
+ runtime.Register(emulator);
+
+ const TInstant start = Now();
+ while (Now() - start < TDuration::Seconds(15) && !emulator->IsInitialized()) {
+ runtime.SimulateSleep(TDuration::Seconds(1));
+ }
+ UNIT_ASSERT(emulator->IsInitialized());
+ Cerr << "Initialization finished" << Endl;
+
+ lHelper.StartDataRequest("SELECT * FROM `/Root/.metadata/test`");
+ lHelper.StartSchemaRequest("DROP TABLE `/Root/.metadata/test`", false);
+ }
+}
+}
diff --git a/ydb/services/metadata/manager/CMakeLists.txt b/ydb/services/metadata/manager/CMakeLists.txt
index f62c406dac..0dce21b960 100644
--- a/ydb/services/metadata/manager/CMakeLists.txt
+++ b/ydb/services/metadata/manager/CMakeLists.txt
@@ -27,6 +27,7 @@ target_sources(services-metadata-manager PRIVATE
${CMAKE_SOURCE_DIR}/ydb/services/metadata/manager/restore.cpp
${CMAKE_SOURCE_DIR}/ydb/services/metadata/manager/modification.cpp
${CMAKE_SOURCE_DIR}/ydb/services/metadata/manager/generic_manager.cpp
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/manager/init_manager.cpp
${CMAKE_SOURCE_DIR}/ydb/services/metadata/manager/preparation_controller.cpp
${CMAKE_SOURCE_DIR}/ydb/services/metadata/manager/restore_controller.cpp
${CMAKE_SOURCE_DIR}/ydb/services/metadata/manager/common.cpp
diff --git a/ydb/services/metadata/manager/generic_manager.cpp b/ydb/services/metadata/manager/generic_manager.cpp
index 51d4f0ed92..125347ef07 100644
--- a/ydb/services/metadata/manager/generic_manager.cpp
+++ b/ydb/services/metadata/manager/generic_manager.cpp
@@ -1,5 +1,5 @@
#include "generic_manager.h"
-namespace NKikimr::NColumnShard::NTiers {
+namespace NKikimr::NMetadata {
}
diff --git a/ydb/services/metadata/manager/init_manager.cpp b/ydb/services/metadata/manager/init_manager.cpp
new file mode 100644
index 0000000000..068dc21bbc
--- /dev/null
+++ b/ydb/services/metadata/manager/init_manager.cpp
@@ -0,0 +1,32 @@
+#include "init_manager.h"
+
+namespace NKikimr::NMetadata {
+
+NThreading::TFuture<TObjectOperatorResult> TInitManagerBase::BuildProcessingError() const
+{
+ TObjectOperatorResult result("manager only for initialization. other operation aren't correct.");
+ return NThreading::MakeFuture<TObjectOperatorResult>(result);
+}
+
+NThreading::TFuture<TObjectOperatorResult> TInitManagerBase::DoCreateObject(
+ const NYql::TCreateObjectSettings& /*settings*/, const ui32 /*nodeId*/,
+ NMetadata::IOperationsManager::TPtr /*manager*/, const TModificationContext& /*context*/) const
+{
+ return BuildProcessingError();
+}
+
+NThreading::TFuture<TObjectOperatorResult> TInitManagerBase::DoAlterObject(
+ const NYql::TAlterObjectSettings& /*settings*/, const ui32 /*nodeId*/,
+ NMetadata::IOperationsManager::TPtr /*manager*/, const TModificationContext& /*context*/) const
+{
+ return BuildProcessingError();
+}
+
+NThreading::TFuture<TObjectOperatorResult> TInitManagerBase::DoDropObject(
+ const NYql::TDropObjectSettings& /*settings*/, const ui32 /*nodeId*/,
+ NMetadata::IOperationsManager::TPtr /*manager*/, const TModificationContext& /*context*/) const
+{
+ return BuildProcessingError();
+}
+
+}
diff --git a/ydb/services/metadata/manager/init_manager.h b/ydb/services/metadata/manager/init_manager.h
new file mode 100644
index 0000000000..e5a2384d69
--- /dev/null
+++ b/ydb/services/metadata/manager/init_manager.h
@@ -0,0 +1,28 @@
+#pragma once
+#include <ydb/services/metadata/abstract/manager.h>
+#include <ydb/services/metadata/manager/common.h>
+#include <ydb/services/metadata/service.h>
+
+namespace NKikimr::NMetadata {
+
+class TInitManagerBase: public NMetadata::IOperationsManager {
+private:
+ NThreading::TFuture<TObjectOperatorResult> BuildProcessingError() const;
+protected:
+ virtual NThreading::TFuture<TObjectOperatorResult> DoCreateObject(
+ const NYql::TCreateObjectSettings& settings, const ui32 nodeId,
+ IOperationsManager::TPtr manager, const TModificationContext& context) const override final;
+ virtual NThreading::TFuture<TObjectOperatorResult> DoAlterObject(
+ const NYql::TAlterObjectSettings& settings, const ui32 nodeId,
+ IOperationsManager::TPtr manager, const TModificationContext& context) const override final;
+ virtual NThreading::TFuture<TObjectOperatorResult> DoDropObject(
+ const NYql::TDropObjectSettings& settings, const ui32 nodeId,
+ IOperationsManager::TPtr manager, const TModificationContext& context) const override final;
+public:
+ virtual TString GetTablePath() const override final {
+ Y_VERIFY(false);
+ return "FAIL";
+ }
+};
+
+}
diff --git a/ydb/services/metadata/secret/ut/CMakeLists.darwin.txt b/ydb/services/metadata/secret/ut/CMakeLists.darwin.txt
index bdab1ede4d..f3e186b34c 100644
--- a/ydb/services/metadata/secret/ut/CMakeLists.darwin.txt
+++ b/ydb/services/metadata/secret/ut/CMakeLists.darwin.txt
@@ -12,21 +12,19 @@ target_compile_options(ydb-services-metadata-secret-ut PRIVATE
-DUSE_CURRENT_UDF_ABI_VERSION
)
target_include_directories(ydb-services-metadata-secret-ut PRIVATE
- ${CMAKE_SOURCE_DIR}/ydb/core/tx/tiering
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/secret
)
target_link_libraries(ydb-services-metadata-secret-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
- core-tx-tiering
+ services-metadata-secret
library-cpp-getopt
cpp-regex-pcre
library-cpp-svnversion
core-testlib-default
ydb-services-metadata
- ydb-core-tx
- core-tx-columnshard
public-lib-yson_value
)
target_link_options(ydb-services-metadata-secret-ut PRIVATE
diff --git a/ydb/services/metadata/secret/ut/CMakeLists.linux-aarch64.txt b/ydb/services/metadata/secret/ut/CMakeLists.linux-aarch64.txt
index 02058cd634..bbf087860d 100644
--- a/ydb/services/metadata/secret/ut/CMakeLists.linux-aarch64.txt
+++ b/ydb/services/metadata/secret/ut/CMakeLists.linux-aarch64.txt
@@ -12,21 +12,19 @@ target_compile_options(ydb-services-metadata-secret-ut PRIVATE
-DUSE_CURRENT_UDF_ABI_VERSION
)
target_include_directories(ydb-services-metadata-secret-ut PRIVATE
- ${CMAKE_SOURCE_DIR}/ydb/core/tx/tiering
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/secret
)
target_link_libraries(ydb-services-metadata-secret-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-lfalloc
cpp-testing-unittest_main
- core-tx-tiering
+ services-metadata-secret
library-cpp-getopt
cpp-regex-pcre
library-cpp-svnversion
core-testlib-default
ydb-services-metadata
- ydb-core-tx
- core-tx-columnshard
public-lib-yson_value
)
target_link_options(ydb-services-metadata-secret-ut PRIVATE
diff --git a/ydb/services/metadata/secret/ut/CMakeLists.linux.txt b/ydb/services/metadata/secret/ut/CMakeLists.linux.txt
index b4cfb6b7da..627a5d2daa 100644
--- a/ydb/services/metadata/secret/ut/CMakeLists.linux.txt
+++ b/ydb/services/metadata/secret/ut/CMakeLists.linux.txt
@@ -12,7 +12,7 @@ target_compile_options(ydb-services-metadata-secret-ut PRIVATE
-DUSE_CURRENT_UDF_ABI_VERSION
)
target_include_directories(ydb-services-metadata-secret-ut PRIVATE
- ${CMAKE_SOURCE_DIR}/ydb/core/tx/tiering
+ ${CMAKE_SOURCE_DIR}/ydb/services/metadata/secret
)
target_link_libraries(ydb-services-metadata-secret-ut PUBLIC
contrib-libs-cxxsupp
@@ -21,14 +21,12 @@ target_link_libraries(ydb-services-metadata-secret-ut PUBLIC
libs-tcmalloc-no_percpu_cache
library-cpp-cpuid_check
cpp-testing-unittest_main
- core-tx-tiering
+ services-metadata-secret
library-cpp-getopt
cpp-regex-pcre
library-cpp-svnversion
core-testlib-default
ydb-services-metadata
- ydb-core-tx
- core-tx-columnshard
public-lib-yson_value
)
target_link_options(ydb-services-metadata-secret-ut PRIVATE
diff --git a/ydb/services/metadata/service.h b/ydb/services/metadata/service.h
index ba9f6dcda7..c84dcabc99 100644
--- a/ydb/services/metadata/service.h
+++ b/ydb/services/metadata/service.h
@@ -15,6 +15,26 @@ public:
}
};
+class TEvPrepareManager: public NActors::TEventLocal<TEvPrepareManager, EEvSubscribe::EvPrepareManager> {
+private:
+ YDB_READONLY_DEF(NMetadata::IOperationsManager::TPtr, Manager);
+public:
+ TEvPrepareManager(NMetadata::IOperationsManager::TPtr manager)
+ : Manager(manager) {
+ Y_VERIFY(!!Manager);
+ }
+};
+
+class TEvManagerPrepared: public NActors::TEventLocal<TEvManagerPrepared, EEvSubscribe::EvManagerPrepared> {
+private:
+ YDB_READONLY_DEF(NMetadata::IOperationsManager::TPtr, Manager);
+public:
+ TEvManagerPrepared(NMetadata::IOperationsManager::TPtr manager)
+ : Manager(manager) {
+ Y_VERIFY(!!Manager);
+ }
+};
+
class TEvAskSnapshot: public NActors::TEventLocal<TEvAskSnapshot, EEvSubscribe::EvAskExternal> {
private:
YDB_READONLY_DEF(ISnapshotsFetcher::TPtr, Fetcher);