Skip to content
Closed
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
6 changes: 2 additions & 4 deletions ydb/core/tx/schemeshard/index/operation_alter_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TPropose: public TSubOperationState {
Y_ABORT_UNLESS(context.SS->Indexes.contains(path->PathId));
auto indexData = context.SS->Indexes.at(path->PathId);
context.SS->PersistTableIndex(db, path->PathId);
context.SS->Indexes.SetUntracked(path->PathId, indexData->AlterData);
context.SS->Indexes.Set(path->PathId, indexData->AlterData);

context.SS->ClearDescribePathCaches(path);
context.OnComplete.PublishToSchemeBoard(OperationId, path->PathId);
Expand Down Expand Up @@ -193,10 +193,8 @@ class TAlterTableIndex: public TSubOperation {
context.DbChanges.PersistAlterIndex(indexPath->PathId);
context.DbChanges.PersistTxState(OperationId);

context.MemChanges.GrabIndex(context.SS, indexPath->PathId);
auto indexData = context.SS->Indexes.Update(indexPath->PathId);
context.MemChanges.RecordUndo([indexData, previous = indexData->AlterData]() {
indexData->AlterData = previous;
});
TTableIndexInfo::TPtr newIndexData = indexData->CreateNextVersion();
Y_ABORT_UNLESS(newIndexData);
newIndexData->State = tableIndexAlter.GetState();
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/schemeshard/index/operation_create_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TPropose: public TSubOperationState {
Y_ABORT_UNLESS(context.SS->Indexes.contains(path->PathId));
auto indexData = context.SS->Indexes.at(path->PathId);
context.SS->PersistTableIndex(db, path->PathId);
context.SS->Indexes.SetUntracked(path->PathId, indexData->AlterData);
context.SS->Indexes.Set(path->PathId, indexData->AlterData);

context.SS->ClearDescribePathCaches(path);
context.OnComplete.PublishToSchemeBoard(OperationId, path->PathId);
Expand Down Expand Up @@ -249,7 +249,8 @@ class TCreateTableIndex: public TSubOperation {
newIndexPath->LastTxId = OperationId.GetTxId();
newIndexPath->PathType = TPathElement::EPathType::EPathTypeTableIndex;

context.SS->Indexes.Set({.Path = newIndexPath->PathId, .Value = newIndexData, .Changes = context.MemChanges});
context.MemChanges.GrabNewIndex(context.SS, newIndexPath->PathId);
context.SS->Indexes.Set(newIndexPath->PathId, newIndexData);

if (!acl.empty()) {
newIndexPath->ApplyACL(acl);
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/schemeshard/index/operation_drop_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class TPropose: public TSubOperationState {
TPathElement::TPtr path = context.SS->PathsById.at(pathId);

Y_ABORT_UNLESS(context.SS->Tables.contains(pathId));
auto& table = context.SS->Tables.UpdateUntracked(pathId);
auto& table = context.SS->Tables.Update(pathId);

NIceDb::TNiceDb db(context.GetDB());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class TPropose: public TSubOperationState {

context.SS->PersistDropSnapshot(db, snapshotTxId, tableId);

auto& tableInfo = context.SS->Tables.UpdateUntracked(txState->TargetPathId);
auto& tableInfo = context.SS->Tables.Update(txState->TargetPathId);
tableInfo->AlterVersion += 1;

for(auto& column: tableInfo->Columns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class TPropose: public TSubOperationState {
context.SS->SnapshotsStepIds[OperationId.GetTxId()] = step;
context.SS->PersistSnapshotStepId(db, OperationId.GetTxId(), step);

auto& tableInfo = context.SS->Tables.UpdateUntracked(txState->TargetPathId);
auto& tableInfo = context.SS->Tables.Update(txState->TargetPathId);
tableInfo->AlterVersion += 1;
context.SS->PersistTableAlterVersion(db, txState->TargetPathId, tableInfo);

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/schemeshard/index/operation_move_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class TDeleteTableBarrier: public TSubOperationState {


TPath path = TPath::Init(txState->TargetPathId, context.SS);
auto& table = context.SS->Tables.UpdateUntracked(txState->TargetPathId);
auto& table = context.SS->Tables.Update(txState->TargetPathId);

Y_ABORT_UNLESS(txState->PlanStep);

Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/schemeshard/index/operation_move_table_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TPropose: public TSubOperationState {

auto indexData = context.SS->Indexes.at(dstPath.Base()->PathId);
context.SS->PersistTableIndex(db, dstPath.Base()->PathId);
context.SS->Indexes.SetUntracked(dstPath.Base()->PathId, indexData->AlterData);
context.SS->Indexes.Set(dstPath.Base()->PathId, indexData->AlterData);

dstPath->StepCreated = step;
context.SS->PersistCreateStep(db, dstPath.Base()->PathId, step);
Expand Down Expand Up @@ -513,7 +513,8 @@ class TMoveTableIndex: public TSubOperation {

const auto srcIndexInfo = context.SS->Indexes.at(srcPath.Base()->PathId);
auto newIndexData = TTableIndexInfo::NotExistedYet(srcIndexInfo->Type);
context.SS->Indexes.Set({.Path = dstPath.Base()->PathId, .Value = newIndexData, .Changes = context.MemChanges});
context.MemChanges.GrabNewIndex(context.SS, dstPath.Base()->PathId);
context.SS->Indexes.Set(dstPath.Base()->PathId, newIndexData);
newIndexData->AlterData = srcIndexInfo->GetNextVersion();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class TPropose: public TSubOperationState {
context.SS->SnapshotsStepIds[OperationId.GetTxId()] = step;
context.SS->PersistSnapshotStepId(db, OperationId.GetTxId(), step);

auto& tableInfo = context.SS->Tables.UpdateUntracked(txState->TargetPathId);
auto& tableInfo = context.SS->Tables.Update(txState->TargetPathId);
tableInfo->AlterVersion += 1;
tableInfo->MutablePartitionConfig().ClearShadowData();
tableInfo->MutablePartitionConfig().MutableCompactionPolicy()->SetKeepEraseMarkers(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TConclusionStatus TInStoreTable::InitializeWithTableInfo(const TEntityInitializa
}

Y_ABORT_UNLESS(context.GetSSOperationContext()->SS->OlapStores.contains(storePathId));
StoreInfo = context.GetSSOperationContext()->SS->OlapStores.UpdateUntracked(storePathId);
StoreInfo = context.GetSSOperationContext()->SS->OlapStores.Update(storePathId);
TOlapSchema schema;
schema.ParseFromLocalDB(GetTableSchemaProto().DetachResult());
TableSchema = std::move(schema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TPropose: public TSubOperationState {
auto indexData = context.SS->Indexes.at(path->PathId);
Y_ABORT_UNLESS(indexData->AlterData, "AlterData must be valid after TTableIndexInfo::Create");
context.SS->PersistTableIndex(db, path->PathId);
context.SS->Indexes.SetUntracked(path->PathId, indexData->AlterData);
context.SS->Indexes.Set(path->PathId, indexData->AlterData);

auto parentPath = TPath::Init(path->PathId, context.SS).Parent();
++parentPath->DirAlterVersion;
Expand Down Expand Up @@ -240,6 +240,7 @@ class TAlterLocalIndex: public TSubOperation {
auto guard = context.DbGuard();
context.MemChanges.GrabPath(context.SS, indexPath.Base()->PathId);
context.MemChanges.GrabNewTxState(context.SS, OperationId);
context.MemChanges.GrabIndex(context.SS, indexPath.Base()->PathId);

context.DbChanges.PersistPath(indexPath.Base()->PathId);
context.DbChanges.PersistAlterIndex(indexPath.Base()->PathId);
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/schemeshard/olap/operations/alter_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class TPropose: public TSubOperationState {
alterData->AlterBody.Clear();
alterData->ColumnTables = storeInfo->ColumnTables;
alterData->ColumnTablesUnderOperation = storeInfo->ColumnTablesUnderOperation;
context.SS->OlapStores.SetUntracked(pathId, alterData);
context.SS->OlapStores.Set(pathId, alterData);

context.SS->PersistOlapStoreAlterRemove(db, pathId);
context.SS->PersistOlapStore(db, pathId, *alterData);
Expand Down Expand Up @@ -514,7 +514,7 @@ class TAlterOlapStore: public TSubOperation {
}

Y_ABORT_UNLESS(context.SS->OlapStores.contains(path->PathId));
auto storeInfo = context.SS->OlapStores.UpdateUntracked(path->PathId);
auto storeInfo = context.SS->OlapStores.Update(path->PathId);

if (!storeInfo->ColumnTablesUnderOperation.empty()) {
result->SetError(NKikimrScheme::StatusMultipleModifications, "Store has unfinished table operations");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TPropose: public TSubOperationState {
auto indexData = context.SS->Indexes.at(path->PathId);
Y_ABORT_UNLESS(indexData->AlterData, "AlterData must be valid after TTableIndexInfo::Create");
context.SS->PersistTableIndex(db, path->PathId);
context.SS->Indexes.SetUntracked(path->PathId, indexData->AlterData);
context.SS->Indexes.Set(path->PathId, indexData->AlterData);

context.SS->ClearDescribePathCaches(path);
context.OnComplete.PublishToSchemeBoard(OperationId, path->PathId);
Expand Down Expand Up @@ -230,7 +230,8 @@ class TCreateLocalIndex: public TSubOperation {
newIndexPath->LastTxId = OperationId.GetTxId();
newIndexPath->PathType = TPathElement::EPathType::EPathTypeTableIndex;

context.SS->Indexes.Set({.Path = newIndexPath->PathId, .Value = newIndexData, .Changes = context.MemChanges});
context.MemChanges.GrabNewIndex(context.SS, newIndexPath->PathId);
context.SS->Indexes.Set(newIndexPath->PathId, newIndexData);

context.OnComplete.ActivateTx(OperationId);

Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/schemeshard/olap/operations/create_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class TPropose: public TSubOperationState {
Y_ABORT_UNLESS(pending);
TOlapStoreInfo::TPtr store = pending->AlterData;
Y_ABORT_UNLESS(store);
context.SS->OlapStores.SetUntracked(pathId, store);
context.SS->OlapStores.Set(pathId, store);

context.SS->PersistOlapStoreAlterRemove(db, pathId);
context.SS->PersistOlapStore(db, pathId, *store);
Expand Down Expand Up @@ -464,7 +464,8 @@ class TCreateOlapStore: public TSubOperation {

TOlapStoreInfo::TPtr pending = std::make_shared<TOlapStoreInfo>();
pending->AlterData = storeInfo;
context.SS->OlapStores.Set({.Path = pathId, .Value = pending, .Changes = context.MemChanges});
context.MemChanges.GrabNewOlapStore(context.SS, pathId);
context.SS->OlapStores.Set(pathId, pending);
context.SS->PersistOlapStore(db, pathId, *pending);
context.SS->PersistOlapStoreAlter(db, pathId, *storeInfo);

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/schemeshard/olap/operations/create_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ class TCreateColumnTable: public TSubOperation {
}

if (auto olapStorePath = parentPath.FindOlapStore()) {
storeInfo = context.SS->OlapStores.UpdateUntracked(olapStorePath->PathId);
storeInfo = context.SS->OlapStores.Update(olapStorePath->PathId);
Y_ABORT_UNLESS(storeInfo, "Unexpected failure to find an tablestore info");

NSchemeShard::TPath::TChecker storeChecks = olapStorePath.Check();
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/schemeshard/olap/operations/drop_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ class TDropColumnTable: public TSubOperation {
}

Y_ABORT_UNLESS(context.SS->OlapStores.contains(storePathId));
auto& storeInfo = context.SS->OlapStores.UpdateUntracked(storePathId);
auto& storeInfo = context.SS->OlapStores.Update(storePathId);

Y_ABORT_UNLESS(storeInfo->ColumnTables.contains(path->PathId));
storeInfo->ColumnTablesUnderOperation.insert(path->PathId);
Expand Down
5 changes: 3 additions & 2 deletions ydb/core/tx/schemeshard/olap/operations/move_local_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class TPropose: public TSubOperationState {
auto indexData = context.SS->Indexes.at(dstPathId);
Y_ABORT_UNLESS(indexData->AlterData, "AlterData must be valid after TTableIndexInfo::Create");
context.SS->PersistTableIndex(db, dstPathId);
context.SS->Indexes.SetUntracked(dstPathId, indexData->AlterData);
context.SS->Indexes.Set(dstPathId, indexData->AlterData);
}

// Drop the source index path (stored in SourcePathId)
Expand Down Expand Up @@ -354,7 +354,8 @@ class TMoveLocalIndex: public TSubOperation {
srcPath.Base()->DropTxId = OperationId.GetTxId();
srcPath.Base()->LastTxId = OperationId.GetTxId();

context.SS->Indexes.Set({.Path = newIndexPath->PathId, .Value = newIndexData, .Changes = context.MemChanges});
context.MemChanges.GrabNewIndex(context.SS, newIndexPath->PathId);
context.SS->Indexes.Set(newIndexPath->PathId, newIndexData);

context.OnComplete.ActivateTx(OperationId);

Expand Down
6 changes: 3 additions & 3 deletions ydb/core/tx/schemeshard/schemeshard__conditional_erase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ struct TSchemeShard::TTxRunConditionalErase: public TSchemeShard::TRwTxBase {
auto mainPath = Self->PathsById.at(mainPathId);

Y_ABORT_UNLESS(Self->Tables.contains(mainPathId));
auto mainTable = Self->Tables.UpdateUntracked(mainPathId);
auto mainTable = Self->Tables.Update(mainPathId);

for (const auto& [_, childPathId] : mainPath->GetChildren()) {
Y_ABORT_UNLESS(Self->PathsById.contains(childPathId));
Expand Down Expand Up @@ -297,7 +297,7 @@ struct TSchemeShard::TTxRunConditionalErase: public TSchemeShard::TRwTxBase {

TTableIndexInfo::TPtr GetIndex(TPathElement::TPtr indexPath) const {
Y_ABORT_UNLESS(Self->Indexes.contains(indexPath->PathId));
return Self->Indexes.UpdateUntracked(indexPath->PathId);
return Self->Indexes.Update(indexPath->PathId);
}

std::pair<TPathId, TTableInfo::TPtr> GetIndexImplTable(TPathElement::TPtr indexPath) const {
Expand All @@ -309,7 +309,7 @@ struct TSchemeShard::TTxRunConditionalErase: public TSchemeShard::TRwTxBase {
Y_ABORT_UNLESS(!childPath->Dropped());

Y_ABORT_UNLESS(Self->Tables.contains(indexImplPathId));
return std::make_pair(indexImplPathId, Self->Tables.UpdateUntracked(indexImplPathId));
return std::make_pair(indexImplPathId, Self->Tables.Update(indexImplPathId));
}

Y_ABORT("Unreachable");
Expand Down
Loading