Skip to content

Extend DisabledOnSchemeShard FF for column tables on dedicated bases #6498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ydb/core/tx/schemeshard/olap/manager/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 4 additions & 6 deletions ydb/core/tx/schemeshard/olap/operations/create_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,10 @@ class TCreateOlapStore: public TSubOperation {
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;
}
if (AppData()->ColumnShardConfig.GetDisabledOnSchemeShard() && context.SS->OlapStores.empty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо бы проверять одновременно и olap-stores, и column-tables?
То же самое в create_table.cpp

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это ослабит запрет. Мы же хотим запретить как можно больше, если клиент ещё не начал этим пользоваться

result->SetError(NKikimrScheme::StatusPreconditionFailed,
"OLAP schema operations are not supported");
return result;
}

NSchemeShard::TPath parentPath = NSchemeShard::TPath::Resolve(parentPathStr, context.SS);
Expand Down
10 changes: 4 additions & 6 deletions ydb/core/tx/schemeshard/olap/operations/create_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,10 @@ class TCreateColumnTable: public TSubOperation {
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;
}
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()) {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/tx/tiering/ut/ut_tiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions ydb/tests/library/harness/resources/default_yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,5 @@ federated_query_config:
uri: ""
pinger:
ping_period: "30s"
column_shard_config:
disabled_on_scheme_shard: false
Loading