From 280796ff91544dc59e5bee47f78dc50db12338c4 Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Wed, 4 Sep 2024 10:17:55 +0000 Subject: [PATCH 1/9] add feature flag: enable olap tiering --- ydb/core/protos/feature_flags.proto | 1 + ydb/core/tx/schemeshard/olap/ttl/schema.cpp | 6 ++++++ ydb/core/tx/schemeshard/olap/ttl/ya.make | 1 + ydb/core/tx/tiering/rule/initializer.cpp | 4 ++++ ydb/core/tx/tiering/tier/initializer.cpp | 4 ++++ 5 files changed, 16 insertions(+) diff --git a/ydb/core/protos/feature_flags.proto b/ydb/core/protos/feature_flags.proto index 8a76b20a69a0..5b09523edefc 100644 --- a/ydb/core/protos/feature_flags.proto +++ b/ydb/core/protos/feature_flags.proto @@ -156,4 +156,5 @@ message TFeatureFlags { optional bool EnableGranularTimecast = 137 [default = true]; optional bool EnableAlterShardingInColumnShard = 138 [default = false]; optional bool EnablePgSyntax = 139 [default = true]; + optional bool EnableOlapTiering = 140 [default = false]; } diff --git a/ydb/core/tx/schemeshard/olap/ttl/schema.cpp b/ydb/core/tx/schemeshard/olap/ttl/schema.cpp index 379f35012d24..922634a8d497 100644 --- a/ydb/core/tx/schemeshard/olap/ttl/schema.cpp +++ b/ydb/core/tx/schemeshard/olap/ttl/schema.cpp @@ -1,11 +1,17 @@ #include "schema.h" +#include +#include + namespace NKikimr::NSchemeShard::NOlap::NAlter { TConclusionStatus TOlapTTL::Update(const TOlapTTLUpdate& update) { const ui64 currentTtlVersion = Proto.GetVersion(); const auto& ttlUpdate = update.GetPatch(); if (ttlUpdate.HasUseTiering()) { + if (HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { + return TConclusionStatus::Fail("Tiering functionality is disabled for OLAP tables."); + } Proto.SetUseTiering(ttlUpdate.GetUseTiering()); } if (ttlUpdate.HasEnabled()) { diff --git a/ydb/core/tx/schemeshard/olap/ttl/ya.make b/ydb/core/tx/schemeshard/olap/ttl/ya.make index 0eb0e83c9a22..8aea246ebddf 100644 --- a/ydb/core/tx/schemeshard/olap/ttl/ya.make +++ b/ydb/core/tx/schemeshard/olap/ttl/ya.make @@ -6,6 +6,7 @@ SRCS( ) PEERDIR( + ydb/core/base ydb/core/protos ) diff --git a/ydb/core/tx/tiering/rule/initializer.cpp b/ydb/core/tx/tiering/rule/initializer.cpp index 96c1c3cff550..075f2e8a6f93 100644 --- a/ydb/core/tx/tiering/rule/initializer.cpp +++ b/ydb/core/tx/tiering/rule/initializer.cpp @@ -35,6 +35,10 @@ TVector TTierRulesInitia } void TTierRulesInitializer::DoPrepare(NMetadata::NInitializer::IInitializerInput::TPtr controller) const { + if (HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { + controller->OnPreparationProblem("Tiering functionality is disabled for OLAP tables."); + return; + } controller->OnPreparationFinished(BuildModifiers()); } diff --git a/ydb/core/tx/tiering/tier/initializer.cpp b/ydb/core/tx/tiering/tier/initializer.cpp index 9bf517856a9a..832fbc2955ad 100644 --- a/ydb/core/tx/tiering/tier/initializer.cpp +++ b/ydb/core/tx/tiering/tier/initializer.cpp @@ -30,6 +30,10 @@ TVector TTiersInitialize } void TTiersInitializer::DoPrepare(NMetadata::NInitializer::IInitializerInput::TPtr controller) const { + if (HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { + controller->OnPreparationProblem("Tiering functionality is disabled for OLAP tables."); + return; + } controller->OnPreparationFinished(BuildModifiers()); } From 7aa74e1d4e77b82ea7a53e777d384d5814e941c3 Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Wed, 4 Sep 2024 10:53:17 +0000 Subject: [PATCH 2/9] set feature-flag in unit-tests --- ydb/core/kqp/ut/common/columnshard.cpp | 45 ++++++++++++++----------- ydb/core/kqp/ut/common/columnshard.h | 6 ++-- ydb/core/testlib/basics/feature_flags.h | 1 + 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ydb/core/kqp/ut/common/columnshard.cpp b/ydb/core/kqp/ut/common/columnshard.cpp index dd9314d90643..5db7e755ad1c 100644 --- a/ydb/core/kqp/ut/common/columnshard.cpp +++ b/ydb/core/kqp/ut/common/columnshard.cpp @@ -31,32 +31,37 @@ namespace NKqp { using namespace NYdb; - TTestHelper::TTestHelper(const TKikimrSettings& settings) - : Kikimr(settings) - , TableClient(Kikimr.GetTableClient()) - , Session(TableClient.CreateSession().GetValueSync().GetSession()) - {} + TTestHelper::TTestHelper(const TKikimrSettings& settings) { + TKikimrSettings kikimrSettings(settings); + if (!kikimrSettings.FeatureFlags.HasEnableOlapTiering()) { + kikimrSettings.SetEnableOlapTiering(true); + } + + Kikimr = std::make_unique(kikimrSettings); + TableClient = std::make_unique(Kikimr->GetTableClient()); + Session = std::make_unique(TableClient->CreateSession().GetValueSync().GetSession()); + } NKikimr::NKqp::TKikimrRunner& TTestHelper::GetKikimr() { - return Kikimr; + return *Kikimr; } TTestActorRuntime& TTestHelper::GetRuntime() { - return *Kikimr.GetTestServer().GetRuntime(); + return *Kikimr->GetTestServer().GetRuntime(); } NYdb::NTable::TSession& TTestHelper::GetSession() { - return Session; + return *Session; } void TTestHelper::CreateTable(const TColumnTableBase& table, const EStatus expectedStatus) { std::cerr << (table.BuildQuery()) << std::endl; - auto result = Session.ExecuteSchemeQuery(table.BuildQuery()).GetValueSync(); + auto result = GetSession().ExecuteSchemeQuery(table.BuildQuery()).GetValueSync(); UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), expectedStatus, result.GetIssues().ToString()); } void TTestHelper::CreateTier(const TString& tierName) { - auto result = Session.ExecuteSchemeQuery("CREATE OBJECT " + tierName + " (TYPE TIER) WITH tierConfig = `" + GetConfigProtoWithName(tierName) + "`").GetValueSync(); + auto result = GetSession().ExecuteSchemeQuery("CREATE OBJECT " + tierName + " (TYPE TIER) WITH tierConfig = `" + GetConfigProtoWithName(tierName) + "`").GetValueSync(); UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); } @@ -70,43 +75,43 @@ namespace NKqp { } ] })"; - auto result = Session.ExecuteSchemeQuery("CREATE OBJECT IF NOT EXISTS " + ruleName + " (TYPE TIERING_RULE) WITH (defaultColumn = " + columnName + ", description = `" + configTieringStr + "`)").GetValueSync(); + auto result = GetSession().ExecuteSchemeQuery("CREATE OBJECT IF NOT EXISTS " + ruleName + " (TYPE TIERING_RULE) WITH (defaultColumn = " + columnName + ", description = `" + configTieringStr + "`)").GetValueSync(); UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); return ruleName; } void TTestHelper::SetTiering(const TString& tableName, const TString& ruleName) { auto alterQuery = TStringBuilder() << "ALTER TABLE `" << tableName << "` SET (TIERING = '" << ruleName << "')"; - auto result = Session.ExecuteSchemeQuery(alterQuery).GetValueSync(); + auto result = GetSession().ExecuteSchemeQuery(alterQuery).GetValueSync(); UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); } void TTestHelper::ResetTiering(const TString& tableName) { auto alterQuery = TStringBuilder() << "ALTER TABLE `" << tableName << "` RESET (TIERING)"; - auto result = Session.ExecuteSchemeQuery(alterQuery).GetValueSync(); + auto result = GetSession().ExecuteSchemeQuery(alterQuery).GetValueSync(); UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); } void TTestHelper::DropTable(const TString& tableName) { - auto result = Session.DropTable(tableName).GetValueSync(); + auto result = GetSession().DropTable(tableName).GetValueSync(); UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); } void TTestHelper::BulkUpsert(const TColumnTable& table, TTestHelper::TUpdatesBuilder& updates, const Ydb::StatusIds_StatusCode& opStatus /*= Ydb::StatusIds::SUCCESS*/) { Y_UNUSED(opStatus); - NKikimr::Tests::NCS::THelper helper(Kikimr.GetTestServer()); + NKikimr::Tests::NCS::THelper helper(GetKikimr().GetTestServer()); auto batch = updates.BuildArrow(); helper.SendDataViaActorSystem(table.GetName(), batch, opStatus); } void TTestHelper::BulkUpsert(const TColumnTable& table, std::shared_ptr batch, const Ydb::StatusIds_StatusCode& opStatus /*= Ydb::StatusIds::SUCCESS*/) { Y_UNUSED(opStatus); - NKikimr::Tests::NCS::THelper helper(Kikimr.GetTestServer()); + NKikimr::Tests::NCS::THelper helper(GetKikimr().GetTestServer()); helper.SendDataViaActorSystem(table.GetName(), batch, opStatus); } void TTestHelper::ReadData(const TString& query, const TString& expected, const EStatus opStatus /*= EStatus::SUCCESS*/) { - auto it = TableClient.StreamExecuteScanQuery(query).GetValueSync(); + auto it = TableClient->StreamExecuteScanQuery(query).GetValueSync(); UNIT_ASSERT_VALUES_EQUAL_C(it.GetStatus(), EStatus::SUCCESS, it.GetIssues().ToString()); // Means stream successfully get TString result = StreamResultToYson(it, false, opStatus); if (opStatus == EStatus::SUCCESS) { @@ -115,17 +120,17 @@ namespace NKqp { } void TTestHelper::RebootTablets(const TString& tableName) { - auto runtime = Kikimr.GetTestServer().GetRuntime(); + auto runtime = GetKikimr().GetTestServer().GetRuntime(); TActorId sender = runtime->AllocateEdgeActor(); TVector shards; { - auto describeResult = DescribeTable(&Kikimr.GetTestServer(), sender, tableName); + auto describeResult = DescribeTable(&GetKikimr().GetTestServer(), sender, tableName); for (auto shard : describeResult.GetPathDescription().GetColumnTableDescription().GetSharding().GetColumnShards()) { shards.push_back(shard); } } for (auto shard : shards) { - Kikimr.GetTestServer().GetRuntime()->Send(MakePipePerNodeCacheID(false), NActors::TActorId(), new TEvPipeCache::TEvForward( + GetKikimr().GetTestServer().GetRuntime()->Send(MakePipePerNodeCacheID(false), NActors::TActorId(), new TEvPipeCache::TEvForward( new TEvents::TEvPoisonPill(), shard, false)); } } diff --git a/ydb/core/kqp/ut/common/columnshard.h b/ydb/core/kqp/ut/common/columnshard.h index 10f8ab1e9296..201b44ad8ea5 100644 --- a/ydb/core/kqp/ut/common/columnshard.h +++ b/ydb/core/kqp/ut/common/columnshard.h @@ -63,9 +63,9 @@ namespace NKqp { }; private: - TKikimrRunner Kikimr; - NYdb::NTable::TTableClient TableClient; - NYdb::NTable::TSession Session; + std::unique_ptr Kikimr; + std::unique_ptr TableClient; + std::unique_ptr Session; public: TTestHelper(const TKikimrSettings& settings); diff --git a/ydb/core/testlib/basics/feature_flags.h b/ydb/core/testlib/basics/feature_flags.h index b2bfe23c95fb..2e5d5571fe95 100644 --- a/ydb/core/testlib/basics/feature_flags.h +++ b/ydb/core/testlib/basics/feature_flags.h @@ -65,6 +65,7 @@ class TTestFeatureFlagsHolder { FEATURE_FLAG_SETTER(EnableBackupService) FEATURE_FLAG_SETTER(EnableGranularTimecast) FEATURE_FLAG_SETTER(EnablePgSyntax) + FEATURE_FLAG_SETTER(EnableOlapTiering) #undef FEATURE_FLAG_SETTER }; From 533b5be53209b7b4f40ffe47e839a8282179ad48 Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Wed, 4 Sep 2024 11:17:45 +0000 Subject: [PATCH 3/9] fix ut_tiers --- ydb/core/tx/tiering/ut/ut_tiers.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ydb/core/tx/tiering/ut/ut_tiers.cpp b/ydb/core/tx/tiering/ut/ut_tiers.cpp index d80d6aae1c75..6f921b055e0b 100644 --- a/ydb/core/tx/tiering/ut/ut_tiers.cpp +++ b/ydb/core/tx/tiering/ut/ut_tiers.cpp @@ -330,7 +330,8 @@ Y_UNIT_TEST_SUITE(ColumnShardTiers) { serverSettings.GrpcPort = grpcPort; serverSettings.SetDomainName("Root") .SetUseRealThreads(false) - .SetEnableMetadataProvider(true); + .SetEnableMetadataProvider(true) + .SetEnableOlapTiering(true) ; Tests::TServer::TPtr server = new Tests::TServer(serverSettings); @@ -420,6 +421,7 @@ Y_UNIT_TEST_SUITE(ColumnShardTiers) { serverSettings.SetDomainName("Root") .SetUseRealThreads(false) .SetEnableMetadataProvider(true) + .SetEnableOlapTiering(true) .SetAppConfig(appConfig); Tests::TServer::TPtr server = new Tests::TServer(serverSettings); @@ -550,6 +552,7 @@ Y_UNIT_TEST_SUITE(ColumnShardTiers) { serverSettings.SetDomainName("Root") .SetUseRealThreads(false) .SetEnableMetadataProvider(true) + .SetEnableOlapTiering(true) ; Tests::TServer::TPtr server = new Tests::TServer(serverSettings); From 7845e76c7a77bc58b1ba4a3580ea3fe19b62c735 Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Wed, 4 Sep 2024 11:39:26 +0000 Subject: [PATCH 4/9] move validation of ALTER TIERING to Propose --- ydb/core/tx/schemeshard/olap/operations/alter_table.cpp | 7 +++++++ ydb/core/tx/schemeshard/olap/ttl/schema.cpp | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp b/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp index 0409fad44a3c..dd5cdfa0e730 100644 --- a/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp @@ -271,6 +271,13 @@ class TAlterColumnTable: public TSubOperation { return result; } + const bool hasTiering = Transaction.HasAlterColumnTable() && Transaction.GetAlterColumnTable().HasAlterTtlSettings() && + Transaction.GetAlterColumnTable().GetAlterTtlSettings().HasUseTiering(); + if (hasTiering && HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { + result->SetError(NKikimrScheme::StatusPreconditionFailed, "Tiering functionality is disabled for OLAP tables"); + return result; + } + const TString& parentPathStr = Transaction.GetWorkingDir(); const TString& name = Transaction.HasAlterColumnTable() ? Transaction.GetAlterColumnTable().GetName() : Transaction.GetAlterTable().GetName(); LOG_NOTICE_S(context.Ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, diff --git a/ydb/core/tx/schemeshard/olap/ttl/schema.cpp b/ydb/core/tx/schemeshard/olap/ttl/schema.cpp index 922634a8d497..efa5e20d05ba 100644 --- a/ydb/core/tx/schemeshard/olap/ttl/schema.cpp +++ b/ydb/core/tx/schemeshard/olap/ttl/schema.cpp @@ -9,9 +9,6 @@ TConclusionStatus TOlapTTL::Update(const TOlapTTLUpdate& update) { const ui64 currentTtlVersion = Proto.GetVersion(); const auto& ttlUpdate = update.GetPatch(); if (ttlUpdate.HasUseTiering()) { - if (HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { - return TConclusionStatus::Fail("Tiering functionality is disabled for OLAP tables."); - } Proto.SetUseTiering(ttlUpdate.GetUseTiering()); } if (ttlUpdate.HasEnabled()) { From fcb7721a6293df34ffbbfe7c650fe3fa47a383ca Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Wed, 4 Sep 2024 13:10:11 +0000 Subject: [PATCH 5/9] move validation on create tiering --- ydb/core/tx/tiering/rule/initializer.cpp | 4 ---- ydb/core/tx/tiering/rule/manager.cpp | 4 ++++ ydb/core/tx/tiering/tier/initializer.cpp | 4 ---- ydb/core/tx/tiering/tier/manager.cpp | 4 ++++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ydb/core/tx/tiering/rule/initializer.cpp b/ydb/core/tx/tiering/rule/initializer.cpp index 075f2e8a6f93..96c1c3cff550 100644 --- a/ydb/core/tx/tiering/rule/initializer.cpp +++ b/ydb/core/tx/tiering/rule/initializer.cpp @@ -35,10 +35,6 @@ TVector TTierRulesInitia } void TTierRulesInitializer::DoPrepare(NMetadata::NInitializer::IInitializerInput::TPtr controller) const { - if (HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { - controller->OnPreparationProblem("Tiering functionality is disabled for OLAP tables."); - return; - } controller->OnPreparationFinished(BuildModifiers()); } diff --git a/ydb/core/tx/tiering/rule/manager.cpp b/ydb/core/tx/tiering/rule/manager.cpp index 321bfec34593..16349b4d0f6f 100644 --- a/ydb/core/tx/tiering/rule/manager.cpp +++ b/ydb/core/tx/tiering/rule/manager.cpp @@ -13,6 +13,10 @@ void TTieringRulesManager::DoPrepareObjectsBeforeModification(std::vector TTiersInitialize } void TTiersInitializer::DoPrepare(NMetadata::NInitializer::IInitializerInput::TPtr controller) const { - if (HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { - controller->OnPreparationProblem("Tiering functionality is disabled for OLAP tables."); - return; - } controller->OnPreparationFinished(BuildModifiers()); } diff --git a/ydb/core/tx/tiering/tier/manager.cpp b/ydb/core/tx/tiering/tier/manager.cpp index b64439cf62d4..af2840100541 100644 --- a/ydb/core/tx/tiering/tier/manager.cpp +++ b/ydb/core/tx/tiering/tier/manager.cpp @@ -8,6 +8,10 @@ NMetadata::NModifications::TOperationParsingResult TTiersManager::DoBuildPatchFr const NYql::TObjectSettingsImpl& settings, TInternalModificationContext& context) const { + if (HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { + return TConclusionStatus::Fail("Tiering functionality is disabled for OLAP tables."); + } + NMetadata::NInternal::TTableRecord result; result.SetColumn(TTierConfig::TDecoder::TierName, NMetadata::NInternal::TYDBValue::Utf8(settings.GetObjectId())); if (settings.GetObjectId().StartsWith("$") || settings.GetObjectId().StartsWith("_")) { From 02522dfcd2231a5ea6435a6acc8d4f491ca61f15 Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Wed, 4 Sep 2024 14:56:34 +0000 Subject: [PATCH 6/9] fix test --- ydb/core/tx/schemeshard/ut_helpers/test_env.cpp | 1 + ydb/core/tx/schemeshard/ut_helpers/test_env.h | 1 + ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp index 217194a7844a..57470847bf7a 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp +++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp @@ -543,6 +543,7 @@ NSchemeShardUT_Private::TTestEnv::TTestEnv(TTestActorRuntime& runtime, const TTe app.SetEnableAddColumsWithDefaults(opts.EnableAddColumsWithDefaults_); app.SetEnableReplaceIfExistsForExternalEntities(opts.EnableReplaceIfExistsForExternalEntities_); app.SetEnableChangefeedsOnIndexTables(opts.EnableChangefeedsOnIndexTables_); + app.SetEnableOlapTiering(opts.EnableOlapTiering_); app.ColumnShardConfig.SetDisabledOnSchemeShard(false); diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.h b/ydb/core/tx/schemeshard/ut_helpers/test_env.h index 388b50caa579..8e7cfaf6f7c2 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/test_env.h +++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.h @@ -66,6 +66,7 @@ namespace NSchemeShardUT_Private { OPTION(std::optional, EnableReplaceIfExistsForExternalEntities, std::nullopt); OPTION(std::optional, GraphBackendType, std::nullopt); OPTION(std::optional, EnableChangefeedsOnIndexTables, std::nullopt); + OPTION(std::optional, EnableOlapTiering, std::nullopt); #undef OPTION }; diff --git a/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp b/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp index 1681aab2ee75..a7d2ad3aff1a 100644 --- a/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp +++ b/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp @@ -561,7 +561,9 @@ Y_UNIT_TEST_SUITE(TOlap) { Y_UNIT_TEST(AlterTtl) { TTestBasicRuntime runtime; - TTestEnv env(runtime); + TTestEnvOptions options; + options.EnableOlapTiering(true); + TTestEnv env(runtime, options); ui64 txId = 100; TString olapSchema = R"( From 704f488baea3ce680419f90e90555dae997fe625 Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Wed, 4 Sep 2024 14:59:19 +0000 Subject: [PATCH 7/9] update index in proto --- ydb/core/protos/feature_flags.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/core/protos/feature_flags.proto b/ydb/core/protos/feature_flags.proto index 5b09523edefc..fc7346a8c3cb 100644 --- a/ydb/core/protos/feature_flags.proto +++ b/ydb/core/protos/feature_flags.proto @@ -156,5 +156,5 @@ message TFeatureFlags { optional bool EnableGranularTimecast = 137 [default = true]; optional bool EnableAlterShardingInColumnShard = 138 [default = false]; optional bool EnablePgSyntax = 139 [default = true]; - optional bool EnableOlapTiering = 140 [default = false]; + optional bool EnableTieringInColumnShard = 140 [default = false]; } From 96affb81eeb104fea0085a8d178c34ca29325d8f Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Thu, 5 Sep 2024 07:29:58 +0000 Subject: [PATCH 8/9] clean up --- ydb/core/tx/schemeshard/olap/ttl/schema.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/ydb/core/tx/schemeshard/olap/ttl/schema.cpp b/ydb/core/tx/schemeshard/olap/ttl/schema.cpp index efa5e20d05ba..379f35012d24 100644 --- a/ydb/core/tx/schemeshard/olap/ttl/schema.cpp +++ b/ydb/core/tx/schemeshard/olap/ttl/schema.cpp @@ -1,8 +1,5 @@ #include "schema.h" -#include -#include - namespace NKikimr::NSchemeShard::NOlap::NAlter { TConclusionStatus TOlapTTL::Update(const TOlapTTLUpdate& update) { From 43542d1e5b8fe16e11e023501a94ea0617c44f2e Mon Sep 17 00:00:00 2001 From: Semyon Yentsov Date: Thu, 5 Sep 2024 07:37:18 +0000 Subject: [PATCH 9/9] rename feature flag --- ydb/core/kqp/ut/common/columnshard.cpp | 4 ++-- ydb/core/testlib/basics/feature_flags.h | 2 +- ydb/core/tx/schemeshard/olap/operations/alter_table.cpp | 2 +- ydb/core/tx/schemeshard/ut_helpers/test_env.cpp | 2 +- ydb/core/tx/schemeshard/ut_helpers/test_env.h | 2 +- ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp | 2 +- ydb/core/tx/tiering/rule/manager.cpp | 2 +- ydb/core/tx/tiering/tier/manager.cpp | 2 +- ydb/core/tx/tiering/ut/ut_tiers.cpp | 6 +++--- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ydb/core/kqp/ut/common/columnshard.cpp b/ydb/core/kqp/ut/common/columnshard.cpp index 5db7e755ad1c..955e260b5985 100644 --- a/ydb/core/kqp/ut/common/columnshard.cpp +++ b/ydb/core/kqp/ut/common/columnshard.cpp @@ -33,8 +33,8 @@ namespace NKqp { TTestHelper::TTestHelper(const TKikimrSettings& settings) { TKikimrSettings kikimrSettings(settings); - if (!kikimrSettings.FeatureFlags.HasEnableOlapTiering()) { - kikimrSettings.SetEnableOlapTiering(true); + if (!kikimrSettings.FeatureFlags.HasEnableTieringInColumnShard()) { + kikimrSettings.SetEnableTieringInColumnShard(true); } Kikimr = std::make_unique(kikimrSettings); diff --git a/ydb/core/testlib/basics/feature_flags.h b/ydb/core/testlib/basics/feature_flags.h index 2e5d5571fe95..1dbdab825a3c 100644 --- a/ydb/core/testlib/basics/feature_flags.h +++ b/ydb/core/testlib/basics/feature_flags.h @@ -65,7 +65,7 @@ class TTestFeatureFlagsHolder { FEATURE_FLAG_SETTER(EnableBackupService) FEATURE_FLAG_SETTER(EnableGranularTimecast) FEATURE_FLAG_SETTER(EnablePgSyntax) - FEATURE_FLAG_SETTER(EnableOlapTiering) + FEATURE_FLAG_SETTER(EnableTieringInColumnShard) #undef FEATURE_FLAG_SETTER }; diff --git a/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp b/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp index dd5cdfa0e730..4fb76b4a75a0 100644 --- a/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/alter_table.cpp @@ -273,7 +273,7 @@ class TAlterColumnTable: public TSubOperation { const bool hasTiering = Transaction.HasAlterColumnTable() && Transaction.GetAlterColumnTable().HasAlterTtlSettings() && Transaction.GetAlterColumnTable().GetAlterTtlSettings().HasUseTiering(); - if (hasTiering && HasAppData() && !AppDataVerified().FeatureFlags.GetEnableOlapTiering()) { + if (hasTiering && HasAppData() && !AppDataVerified().FeatureFlags.GetEnableTieringInColumnShard()) { result->SetError(NKikimrScheme::StatusPreconditionFailed, "Tiering functionality is disabled for OLAP tables"); return result; } diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp index 57470847bf7a..2c418d6a9626 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp +++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp @@ -543,7 +543,7 @@ NSchemeShardUT_Private::TTestEnv::TTestEnv(TTestActorRuntime& runtime, const TTe app.SetEnableAddColumsWithDefaults(opts.EnableAddColumsWithDefaults_); app.SetEnableReplaceIfExistsForExternalEntities(opts.EnableReplaceIfExistsForExternalEntities_); app.SetEnableChangefeedsOnIndexTables(opts.EnableChangefeedsOnIndexTables_); - app.SetEnableOlapTiering(opts.EnableOlapTiering_); + app.SetEnableTieringInColumnShard(opts.EnableTieringInColumnShard_); app.ColumnShardConfig.SetDisabledOnSchemeShard(false); diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.h b/ydb/core/tx/schemeshard/ut_helpers/test_env.h index 8e7cfaf6f7c2..c433855c9c76 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/test_env.h +++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.h @@ -66,7 +66,7 @@ namespace NSchemeShardUT_Private { OPTION(std::optional, EnableReplaceIfExistsForExternalEntities, std::nullopt); OPTION(std::optional, GraphBackendType, std::nullopt); OPTION(std::optional, EnableChangefeedsOnIndexTables, std::nullopt); - OPTION(std::optional, EnableOlapTiering, std::nullopt); + OPTION(std::optional, EnableTieringInColumnShard, std::nullopt); #undef OPTION }; diff --git a/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp b/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp index a7d2ad3aff1a..90a14c747f8a 100644 --- a/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp +++ b/ydb/core/tx/schemeshard/ut_olap/ut_olap.cpp @@ -562,7 +562,7 @@ Y_UNIT_TEST_SUITE(TOlap) { Y_UNIT_TEST(AlterTtl) { TTestBasicRuntime runtime; TTestEnvOptions options; - options.EnableOlapTiering(true); + options.EnableTieringInColumnShard(true); TTestEnv env(runtime, options); ui64 txId = 100; diff --git a/ydb/core/tx/tiering/rule/manager.cpp b/ydb/core/tx/tiering/rule/manager.cpp index 16349b4d0f6f..a97ba742467a 100644 --- a/ydb/core/tx/tiering/rule/manager.cpp +++ b/ydb/core/tx/tiering/rule/manager.cpp @@ -13,7 +13,7 @@ void TTieringRulesManager::DoPrepareObjectsBeforeModification(std::vector