diff --git a/ydb/core/tx/schemeshard/olap/manager/manager.h b/ydb/core/tx/schemeshard/olap/manager/manager.h index d4ff264ec874..96ffc91204eb 100644 --- a/ydb/core/tx/schemeshard/olap/manager/manager.h +++ b/ydb/core/tx/schemeshard/olap/manager/manager.h @@ -104,7 +104,9 @@ class TTablesStorage { TTableCreatedGuard BuildNew(const TPathId& id, TColumnTableInfo::TPtr object); TTableExtractedGuard TakeVerified(const TPathId& id); TTableExtractedGuard TakeAlterVerified(const TPathId& id); - + bool empty() const { + return Tables.empty(); + } bool contains(const TPathId& id) const { return Tables.contains(id); } diff --git a/ydb/core/tx/schemeshard/olap/operations/create_store.cpp b/ydb/core/tx/schemeshard/olap/operations/create_store.cpp index 137c42d8fd4c..bc27020ddc45 100644 --- a/ydb/core/tx/schemeshard/olap/operations/create_store.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/create_store.cpp @@ -327,12 +327,10 @@ class TCreateOlapStore: public TSubOperation { TEvSchemeShard::EStatus status = NKikimrScheme::StatusAccepted; auto result = MakeHolder(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; - } + if (AppData()->ColumnShardConfig.GetDisabledOnSchemeShard() && context.SS->OlapStores.empty()) { + result->SetError(NKikimrScheme::StatusPreconditionFailed, + "OLAP schema operations are not supported"); + return result; } NSchemeShard::TPath parentPath = NSchemeShard::TPath::Resolve(parentPathStr, context.SS); diff --git a/ydb/core/tx/schemeshard/olap/operations/create_table.cpp b/ydb/core/tx/schemeshard/olap/operations/create_table.cpp index 0f4c491b76f1..7018d09e2ead 100644 --- a/ydb/core/tx/schemeshard/olap/operations/create_table.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/create_table.cpp @@ -582,12 +582,10 @@ class TCreateColumnTable: public TSubOperation { TEvSchemeShard::EStatus status = NKikimrScheme::StatusAccepted; auto result = MakeHolder(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; - } + if (AppData()->ColumnShardConfig.GetDisabledOnSchemeShard() && context.SS->ColumnTables.empty()) { + result->SetError(NKikimrScheme::StatusPreconditionFailed, + "OLAP schema operations are not supported"); + return result; } if (createDescription.GetSharding().GetColumnShards().size()) { diff --git a/ydb/core/tx/tiering/ut/ut_tiers.cpp b/ydb/core/tx/tiering/ut/ut_tiers.cpp index 9eeb50b23257..55fd3a3437e5 100644 --- a/ydb/core/tx/tiering/ut/ut_tiers.cpp +++ b/ydb/core/tx/tiering/ut/ut_tiers.cpp @@ -418,6 +418,7 @@ Y_UNIT_TEST_SUITE(ColumnShardTiers) { NKikimrConfig::TAppConfig appConfig; appConfig.MutableTableServiceConfig()->SetEnablePreparedDdl(true); + appConfig.MutableColumnShardConfig()->SetDisabledOnSchemeShard(false); Tests::TServerSettings serverSettings(msgbPort); serverSettings.Port = msgbPort; diff --git a/ydb/tests/library/harness/resources/default_yaml.yml b/ydb/tests/library/harness/resources/default_yaml.yml index 7090fad7dedc..dc8eea16bf2e 100644 --- a/ydb/tests/library/harness/resources/default_yaml.yml +++ b/ydb/tests/library/harness/resources/default_yaml.yml @@ -256,3 +256,5 @@ federated_query_config: uri: "" pinger: ping_period: "30s" +column_shard_config: + disabled_on_scheme_shard: false