diff options
author | nsofya <nsofya@yandex-team.com> | 2023-08-30 12:37:39 +0300 |
---|---|---|
committer | nsofya <nsofya@yandex-team.com> | 2023-08-30 13:29:43 +0300 |
commit | aec8d0c5a9d4ff5c67d5a85ac4c642b8ecc25590 (patch) | |
tree | d9cd9c9de47606a091214503afca433a82aea24d | |
parent | 518a643cc2da2d6313a4bbe2169f9dcaced332f3 (diff) | |
download | ydb-aec8d0c5a9d4ff5c67d5a85ac4c642b8ecc25590.tar.gz |
KIKIMR-18933: DisabledOnSchemeShard flag
-rw-r--r-- | ydb/core/kqp/ut/common/kqp_ut_common.cpp | 5 | ||||
-rw-r--r-- | ydb/core/kqp/ut/common/kqp_ut_common.h | 1 | ||||
-rw-r--r-- | ydb/core/protos/config.proto | 2 | ||||
-rw-r--r-- | ydb/core/testlib/test_client.h | 2 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp | 20 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp | 20 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp | 6 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/ut_helpers/test_env.cpp | 3 | ||||
-rw-r--r-- | ydb/core/tx/schemeshard/ut_helpers/test_env.h | 1 |
9 files changed, 32 insertions, 28 deletions
diff --git a/ydb/core/kqp/ut/common/kqp_ut_common.cpp b/ydb/core/kqp/ut/common/kqp_ut_common.cpp index 1b7ee9bd40..fa2fc041c6 100644 --- a/ydb/core/kqp/ut/common/kqp_ut_common.cpp +++ b/ydb/core/kqp/ut/common/kqp_ut_common.cpp @@ -110,7 +110,10 @@ TKikimrRunner::TKikimrRunner(const TKikimrSettings& settings) { ServerSettings.Reset(MakeHolder<Tests::TServerSettings>(mbusPort, NKikimrProto::TAuthConfig(), settings.PQConfig)); ServerSettings->SetDomainName(settings.DomainRoot); ServerSettings->SetKqpSettings(effectiveKqpSettings); - ServerSettings->SetAppConfig(settings.AppConfig); + + NKikimrConfig::TAppConfig appConfig = settings.AppConfig; + appConfig.MutableColumnShardConfig()->SetDisabledOnSchemeShard(false); + ServerSettings->SetAppConfig(appConfig); ServerSettings->SetFeatureFlags(settings.FeatureFlags); ServerSettings->SetNodeCount(settings.NodeCount); ServerSettings->SetEnableKqpSpilling(enableSpilling); diff --git a/ydb/core/kqp/ut/common/kqp_ut_common.h b/ydb/core/kqp/ut/common/kqp_ut_common.h index 767b198f5a..22e76d202b 100644 --- a/ydb/core/kqp/ut/common/kqp_ut_common.h +++ b/ydb/core/kqp/ut/common/kqp_ut_common.h @@ -92,6 +92,7 @@ struct TKikimrSettings: public TTestFeatureFlagsHolder<TKikimrSettings> { auto* exchangerSettings = infoExchangerRetrySettings->MutableExchangerSettings(); exchangerSettings->SetStartDelayMs(10); exchangerSettings->SetMaxDelayMs(10); + AppConfig.MutableColumnShardConfig()->SetDisabledOnSchemeShard(false); } TKikimrSettings& SetAppConfig(const NKikimrConfig::TAppConfig& value) { AppConfig = value; return *this; } diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index 6871f2d54d..658e61f75f 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1766,6 +1766,7 @@ message TDataShardConfig { optional uint64 RestoreReadBufferSizeLimit = 16 [default = 268435456]; // 256 MB optional string CdcInitialScanTaskName = 17 [default = "cdc_initial_scan"]; optional uint32 CdcInitialScanTaskPriority = 18 [default = 10]; + optional bool DisabledOnSchemeShard = 19 [default = false]; } message TColumnShardConfig { @@ -1783,6 +1784,7 @@ message TColumnShardConfig { } optional TTablesStorageLayoutPolicy TablesStorageLayoutPolicy = 1; + optional bool DisabledOnSchemeShard = 2 [default = true]; } message TSchemeShardConfig { diff --git a/ydb/core/testlib/test_client.h b/ydb/core/testlib/test_client.h index 0c102188f2..fe9e3f42b9 100644 --- a/ydb/core/testlib/test_client.h +++ b/ydb/core/testlib/test_client.h @@ -215,6 +215,7 @@ namespace Tests { AppConfig.MutableTableServiceConfig()->MutableResourceManager()->MutableShardsScanningPolicy()->SetParallelScanningAvailable(true); AppConfig.MutableTableServiceConfig()->MutableResourceManager()->MutableShardsScanningPolicy()->SetShardSplitFactor(16); AppConfig.MutableHiveConfig()->SetWarmUpBootWaitingPeriod(10); + AppConfig.MutableColumnShardConfig()->SetDisabledOnSchemeShard(false); FeatureFlags.SetEnableSeparationComputeActorsFromRead(true); } @@ -224,7 +225,6 @@ namespace Tests { YDB_FLAG_ACCESSOR(EnableMetadataProvider, true); YDB_FLAG_ACCESSOR(EnableBackgroundTasks, false); YDB_FLAG_ACCESSOR(EnableExternalIndex, false); - }; class TServer : public TThrRefBase, TMoveOnly { diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp index 83dc17b481..f1ec1774bc 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp @@ -329,6 +329,14 @@ public: TEvSchemeShard::EStatus status = NKikimrScheme::StatusAccepted; auto result = MakeHolder<TProposeResponse>(status, ui64(OperationId.GetTxId()), ui64(ssId)); + if (context.SS->IsServerlessDomain(TPath::Init(context.SS->RootPathId(), context.SS))) { + if (AppData()->ColumnShardConfig.GetDisabledOnSchemeShard()) { + result->SetError(NKikimrScheme::StatusPreconditionFailed, + "OLAP schema operations are not supported"); + return result; + } + } + NSchemeShard::TPath parentPath = NSchemeShard::TPath::Resolve(parentPathStr, context.SS); { NSchemeShard::TPath::TChecker checks = parentPath.Check(); @@ -390,18 +398,6 @@ public: return result; } - if (!AppData()->FeatureFlags.GetEnableOlapSchemaOperations()) { - result->SetError(NKikimrScheme::StatusPreconditionFailed, - "Olap schema operations are not supported"); - return result; - } - - if (context.SS->IsServerlessDomain(TPath::Init(context.SS->RootPathId(), context.SS))) { - result->SetError(NKikimrScheme::StatusPreconditionFailed, - "Olap schema operations are not supported in serverless db"); - return result; - } - TProposeErrorCollector errors(*result); TOlapStoreInfo::TPtr storeInfo = new TOlapStoreInfo; if (!storeInfo->ParseFromRequest(createDescription, errors)) { diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp index c6c0ddd84b..b953d1db7c 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp @@ -586,6 +586,14 @@ public: TEvSchemeShard::EStatus status = NKikimrScheme::StatusAccepted; auto result = MakeHolder<TProposeResponse>(status, ui64(opTxId), ui64(ssId)); + if (context.SS->IsServerlessDomain(TPath::Init(context.SS->RootPathId(), context.SS))) { + if (AppData()->ColumnShardConfig.GetDisabledOnSchemeShard()) { + result->SetError(NKikimrScheme::StatusPreconditionFailed, + "OLAP schema operations are not supported"); + return result; + } + } + TOlapStoreInfo::TPtr storeInfo; NSchemeShard::TPath parentPath = NSchemeShard::TPath::Resolve(parentPathStr, context.SS); { @@ -670,18 +678,6 @@ public: return result; } - if (!AppData()->FeatureFlags.GetEnableOlapSchemaOperations()) { - result->SetError(NKikimrScheme::StatusPreconditionFailed, - "Olap schema operations are not supported"); - return result; - } - - if (context.SS->IsServerlessDomain(TPath::Init(context.SS->RootPathId(), context.SS))) { - result->SetError(NKikimrScheme::StatusPreconditionFailed, - "Olap schema operations are not supported in serverless db"); - return result; - } - TProposeErrorCollector errors(*result); TColumnTableInfo::TPtr tableInfo; if (storeInfo) { diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp index af57ba3e9e..6e491fc81e 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp @@ -420,6 +420,12 @@ public: auto result = MakeHolder<TProposeResponse>(NKikimrScheme::StatusAccepted, ui64(OperationId.GetTxId()), ui64(ssId)); + if (AppData()->DataShardConfig.GetDisabledOnSchemeShard()) { + result->SetError(NKikimrScheme::StatusPreconditionFailed, + "OLTP schema operations are not supported"); + return result; + } + NSchemeShard::TPath parentPath = NSchemeShard::TPath::Resolve(parentPathStr, context.SS); { NSchemeShard::TPath::TChecker checks = parentPath.Check(); diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp index 6770dfbb61..b6bd112404 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp +++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp @@ -524,7 +524,6 @@ NSchemeShardUT_Private::TTestEnv::TTestEnv(TTestActorRuntime& runtime, const TTe app.SetEnablePersistentPartitionStats(opts.EnablePersistentPartitionStats_); app.SetAllowUpdateChannelsBindingOfSolomonPartitions(opts.AllowUpdateChannelsBindingOfSolomonPartitions_); app.SetEnableNotNullColumns(opts.EnableNotNullColumns_); - app.SetEnableOlapSchemaOperations(opts.EnableOlapSchemaOperations_); app.SetEnableProtoSourceIdInfo(opts.EnableProtoSourceIdInfo_); app.SetEnablePqBilling(opts.EnablePqBilling_); app.SetEnableBackgroundCompaction(opts.EnableBackgroundCompaction_); @@ -539,6 +538,8 @@ NSchemeShardUT_Private::TTestEnv::TTestEnv(TTestActorRuntime& runtime, const TTe app.SetEnableTopicSplitMerge(opts.EnableTopicSplitMerge_); app.SetEnableChangefeedDynamoDBStreamsFormat(opts.EnableChangefeedDynamoDBStreamsFormat_); + app.ColumnShardConfig.SetDisabledOnSchemeShard(false); + if (opts.DisableStatsBatching_.value_or(false)) { app.SchemeShardConfig.SetStatsMaxBatchSize(0); app.SchemeShardConfig.SetStatsBatchTimeoutMs(0); diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.h b/ydb/core/tx/schemeshard/ut_helpers/test_env.h index 56729064c1..88d9914fad 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/test_env.h +++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.h @@ -41,7 +41,6 @@ namespace NSchemeShardUT_Private { OPTION(std::optional<bool>, EnablePersistentPartitionStats, std::nullopt); OPTION(std::optional<bool>, AllowUpdateChannelsBindingOfSolomonPartitions, std::nullopt); OPTION(std::optional<bool>, EnableNotNullColumns, std::nullopt); - OPTION(std::optional<bool>, EnableOlapSchemaOperations, true); OPTION(std::optional<bool>, EnableProtoSourceIdInfo, std::nullopt); OPTION(std::optional<bool>, EnablePqBilling, std::nullopt); OPTION(std::optional<bool>, EnableBackgroundCompaction, std::nullopt); |