aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchertus <azuikov@ydb.tech>2023-04-10 17:35:25 +0300
committerchertus <azuikov@ydb.tech>2023-04-10 17:35:25 +0300
commit4b2f3ef57362cbccf0e48cc75f78735f21f66db5 (patch)
tree4239d230305b3120141fda6099c8291526304fbf
parentc6c5b4a72c1f23e9c0b7f27ba35d51dfa7731594 (diff)
downloadydb-4b2f3ef57362cbccf0e48cc75f78735f21f66db5.tar.gz
disable ColumnTables in Serverless DB
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp22
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp12
2 files changed, 23 insertions, 11 deletions
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 48fae9cfcd..18d36b5652 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_store.cpp
@@ -39,8 +39,8 @@ bool PrepareSchemaPreset(NKikimrSchemeOp::TColumnTableSchemaPreset& proto, TOlap
return false;
}
proto.Clear();
- preset.Serialize(proto);
-
+ preset.Serialize(proto);
+
store.Description.SetNextSchemaPresetId(presetId + 1);
store.SchemaPresetByName[preset.GetName()] = preset.GetId();
store.SchemaPresets[preset.GetId()] = std::move(preset);
@@ -153,7 +153,7 @@ public:
DebugHint() << " ProgressState"
<< " at tabletId# " << ssId);
- TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
+ TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
TOlapStoreInfo::TPtr pendingInfo = context.SS->OlapStores[txState->TargetPathId];
Y_VERIFY(pendingInfo);
Y_VERIFY(pendingInfo->AlterData);
@@ -165,7 +165,7 @@ public:
auto seqNo = context.SS->StartRound(*txState);
NKikimrTxColumnShard::TSchemaTxBody tx;
context.SS->FillSeqNo(tx, seqNo);
-
+
NSchemeShard::TPath path = NSchemeShard::TPath::Init(txState->TargetPathId, context.SS);
Y_VERIFY(path.IsResolved());
@@ -234,7 +234,7 @@ public:
<< " at tablet: " << ssId
<< ", stepId: " << step);
- TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
+ TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
TPathId pathId = txState->TargetPathId;
TPathElement::TPtr path = context.SS->PathsById.at(pathId);
@@ -277,7 +277,7 @@ public:
DebugHint() << " ProgressState"
<< " at tablet: " << ssId);
- TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
+ TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
TSet<TTabletId> shardSet;
for (const auto& shard : txState->Shards) {
@@ -312,7 +312,7 @@ public:
}
bool HandleReply(TEvColumnShard::TEvNotifyTxCompletionResult::TPtr& ev, TOperationContext& context) override {
- TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
+ TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
auto shardId = TTabletId(ev->Get()->Record.GetOrigin());
auto shardIdx = context.SS->MustGetShardIdx(shardId);
@@ -329,7 +329,7 @@ public:
DebugHint() << " ProgressState"
<< " at tablet: " << ssId);
- TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
+ TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateOlapStore);
txState->ClearShardsInProgress();
for (auto& shard : txState->Shards) {
@@ -485,6 +485,12 @@ public:
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 = CreateOlapStore(createDescription, errors);
if (!storeInfo.Get()) {
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 404cb6d4f3..fdf6b4e136 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_olap_table.cpp
@@ -41,7 +41,7 @@ public:
errors.AddError("Sharding is not set");
return false;
}
-
+
if (!DoDeserialize(description, errors)) {
return false;
}
@@ -58,7 +58,7 @@ public:
TColumnTableInfo::TPtr BuildTableInfo(IErrorCollector& errors) const {
TColumnTableInfo::TPtr tableInfo = new TColumnTableInfo;
tableInfo->AlterVersion = 1;
-
+
BuildDescription(tableInfo->Description);
tableInfo->Description.SetColumnShardCount(ShardsCount);
tableInfo->Description.SetName(Name);
@@ -275,7 +275,7 @@ public:
DebugHint() << " ProgressState"
<< " at tabletId# " << ssId);
- TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateColumnTable);
+ TTxState* txState = context.SS->FindTxSafe(OperationId, TTxState::TxCreateColumnTable);
TPathId pathId = txState->TargetPathId;
TPath path = TPath::Init(pathId, context.SS);
@@ -682,6 +682,12 @@ public:
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) {