From cad3451343927115602034658aa837542a687a70 Mon Sep 17 00:00:00 2001 From: Alexey Efimov Date: Mon, 13 Jan 2025 04:43:59 +0000 Subject: [PATCH] return grandchildren flag --- ydb/core/protos/flat_scheme_op.proto | 1 + .../olap/operations/create_store.cpp | 2 +- .../olap/operations/create_table.cpp | 2 +- .../olap/operations/drop_store.cpp | 2 +- .../olap/operations/drop_table.cpp | 2 +- ydb/core/tx/schemeshard/schemeshard__init.cpp | 2 +- .../schemeshard__operation_blob_depot.cpp | 6 +-- .../schemeshard__operation_common.cpp | 47 +++++++++++++++++++ .../schemeshard__operation_common.h | 5 ++ .../schemeshard__operation_copy_sequence.cpp | 2 +- .../schemeshard__operation_copy_table.cpp | 2 +- ...rd__operation_create_backup_collection.cpp | 10 ++-- .../schemeshard__operation_create_bsv.cpp | 2 +- ...hemeshard__operation_create_cdc_stream.cpp | 2 +- ..._operation_create_external_data_source.cpp | 8 +--- ...shard__operation_create_external_table.cpp | 9 +--- ...meshard__operation_create_extsubdomain.cpp | 2 +- .../schemeshard__operation_create_fs.cpp | 2 +- .../schemeshard__operation_create_index.cpp | 2 +- .../schemeshard__operation_create_kesus.cpp | 2 +- .../schemeshard__operation_create_pq.cpp | 2 +- ...emeshard__operation_create_replication.cpp | 2 +- ...eshard__operation_create_resource_pool.cpp | 8 +--- .../schemeshard__operation_create_rtmr.cpp | 2 +- ...schemeshard__operation_create_sequence.cpp | 2 +- .../schemeshard__operation_create_solomon.cpp | 2 +- ...chemeshard__operation_create_subdomain.cpp | 2 +- .../schemeshard__operation_create_table.cpp | 2 +- .../schemeshard__operation_create_view.cpp | 3 +- ...hard__operation_drop_backup_collection.cpp | 2 +- .../schemeshard__operation_drop_bsv.cpp | 4 +- ...schemeshard__operation_drop_cdc_stream.cpp | 2 +- ...d__operation_drop_external_data_source.cpp | 2 +- ...meshard__operation_drop_external_table.cpp | 2 +- .../schemeshard__operation_drop_fs.cpp | 2 +- ...emeshard__operation_drop_indexed_table.cpp | 4 +- .../schemeshard__operation_drop_kesus.cpp | 2 +- .../schemeshard__operation_drop_pq.cpp | 2 +- ...chemeshard__operation_drop_replication.cpp | 2 +- ...emeshard__operation_drop_resource_pool.cpp | 4 +- .../schemeshard__operation_drop_sequence.cpp | 2 +- .../schemeshard__operation_drop_table.cpp | 2 +- .../schemeshard__operation_drop_view.cpp | 2 +- .../schemeshard__operation_mkdir.cpp | 2 +- .../schemeshard__operation_move_sequence.cpp | 6 +-- .../schemeshard__operation_move_table.cpp | 4 +- ...chemeshard__operation_move_table_index.cpp | 4 +- .../schemeshard__operation_rmdir.cpp | 3 +- ydb/core/tx/schemeshard/schemeshard_impl.cpp | 2 +- .../schemeshard_path_describer.cpp | 2 + .../schemeshard/schemeshard_path_element.cpp | 24 ++++------ .../tx/schemeshard/schemeshard_path_element.h | 5 +- ydb/core/tx/schemeshard/ut_base/ut_base.cpp | 30 ++++++------ .../tx/schemeshard/ut_reboots/ut_reboots.cpp | 10 ++-- .../schemeshard/ut_subdomain/ut_subdomain.cpp | 30 ++++++------ .../ut_subdomain_reboots.cpp | 2 +- .../ut_user_attributes/ut_user_attributes.cpp | 2 +- .../ut_user_attributes_reboots.cpp | 4 +- 58 files changed, 168 insertions(+), 133 deletions(-) diff --git a/ydb/core/protos/flat_scheme_op.proto b/ydb/core/protos/flat_scheme_op.proto index beb279f261db..d89282a9ac06 100644 --- a/ydb/core/protos/flat_scheme_op.proto +++ b/ydb/core/protos/flat_scheme_op.proto @@ -1862,6 +1862,7 @@ message TDirEntry { optional uint64 PathVersion = 13; optional EPathSubType PathSubType = 14; optional TPathVersion Version = 15; + optional bool ChildrenExist = 16; optional uint64 BalancerTabletID = 999; //temporary optimization for old PQ read/write protocol. Must be removed later } diff --git a/ydb/core/tx/schemeshard/olap/operations/create_store.cpp b/ydb/core/tx/schemeshard/olap/operations/create_store.cpp index 6b700b29ee19..9f6cccb799db 100644 --- a/ydb/core/tx/schemeshard/olap/operations/create_store.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/create_store.cpp @@ -503,7 +503,7 @@ class TCreateOlapStore: public TSubOperation { dstPath.DomainInfo()->IncPathsInside(); dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/olap/operations/create_table.cpp b/ydb/core/tx/schemeshard/olap/operations/create_table.cpp index a407a991689c..92d5267fd794 100644 --- a/ydb/core/tx/schemeshard/olap/operations/create_table.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/create_table.cpp @@ -866,7 +866,7 @@ class TCreateColumnTable: public TSubOperation { dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(tableInfo->GetOwnedColumnShardsVerified().size()); } - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState(!!storeInfo)); return result; diff --git a/ydb/core/tx/schemeshard/olap/operations/drop_store.cpp b/ydb/core/tx/schemeshard/olap/operations/drop_store.cpp index 06c717e52a2a..ab1addac4a50 100644 --- a/ydb/core/tx/schemeshard/olap/operations/drop_store.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/drop_store.cpp @@ -93,7 +93,7 @@ class TPropose: public TSubOperationState { auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop context.SS->TabletCounters->Simple()[COUNTER_USER_ATTRIBUTES_COUNT].Sub(path->UserAttrs->Size()); context.SS->PersistUserAttributes(db, path->PathId, path->UserAttrs, nullptr); diff --git a/ydb/core/tx/schemeshard/olap/operations/drop_table.cpp b/ydb/core/tx/schemeshard/olap/operations/drop_table.cpp index 08541ce5dd1f..4f50157d810d 100644 --- a/ydb/core/tx/schemeshard/olap/operations/drop_table.cpp +++ b/ydb/core/tx/schemeshard/olap/operations/drop_table.cpp @@ -132,7 +132,7 @@ class TPropose: public TSubOperationState { auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop context.SS->TabletCounters->Simple()[COUNTER_USER_ATTRIBUTES_COUNT].Sub(path->UserAttrs->Size()); context.SS->PersistUserAttributes(db, path->PathId, path->UserAttrs, nullptr); diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index 4bbc5aace977..28bb678b6db3 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -4112,7 +4112,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase { if (!path->IsRoot()) { const bool isBackupTable = Self->IsBackupTable(item.first); - parent->IncAliveChildren(1, isBackupTable); + parent->IncAliveChildrenPrivate(isBackupTable); inclusiveDomainInfo->IncPathsInside(1, isBackupTable); } diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_blob_depot.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_blob_depot.cpp index 3eb64d22637a..0d9de988d397 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_blob_depot.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_blob_depot.cpp @@ -93,7 +93,7 @@ namespace NKikimr::NSchemeShard { return !txState->ShardsInProgress; } - + TString DebugHint() const override { return TStringBuilder() << "TConfigureBlobDepotParts id# " << OperationId; } @@ -377,10 +377,10 @@ namespace NKikimr::NSchemeShard { dstPath.DomainInfo()->IncPathsInside(); dstPath.DomainInfo()->AddInternalShards(txState); dstPath->IncShardsInside(); - parentPath->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(TTxState::CreateParts); - + auto resp = MakeHolder(NKikimrScheme::StatusAccepted, txId, ssId); resp->SetPathId(pathId.LocalPathId); return resp; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_common.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_common.cpp index 0068d86fc9bb..01c7c17a37b7 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_common.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_common.cpp @@ -1170,6 +1170,53 @@ void IncParentDirAlterVersionWithRepublish(const TOperationId& opId, const TPath } } +void IncAliveChildrenSafeWithUndo(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup) { + parentPath.Base()->IncAliveChildrenPrivate(isBackup); + if (parentPath.Base()->GetAliveChildren() == 1 && !parentPath.Base()->IsDomainRoot()) { + auto grandParent = parentPath.Parent(); + if (grandParent.Base()->IsDirectory() || grandParent.Base()->IsDomainRoot()) { + ++grandParent.Base()->DirAlterVersion; + context.DbChanges.PersistPath(grandParent.Base()->PathId); + } + + if (grandParent.IsActive()) { + context.SS->ClearDescribePathCaches(grandParent.Base()); + context.OnComplete.PublishToSchemeBoard(opId, grandParent->PathId); + } + } +} + +void IncAliveChildrenDirect(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup) { + parentPath.Base()->IncAliveChildrenPrivate(isBackup); + if (parentPath.Base()->GetAliveChildren() == 1 && !parentPath.Base()->IsDomainRoot()) { + auto grandParent = parentPath.Parent(); + if (grandParent.Base()->IsDirectory() || grandParent.Base()->IsDomainRoot()) { + ++grandParent.Base()->DirAlterVersion; + NIceDb::TNiceDb db(context.GetDB()); + context.SS->PersistPathDirAlterVersion(db, grandParent.Base()); + } + + if (grandParent.IsActive()) { + context.SS->ClearDescribePathCaches(grandParent.Base()); + context.OnComplete.PublishToSchemeBoard(opId, grandParent->PathId); + } + } +} + +void DecAliveChildrenDirect(const TOperationId& opId, TPathElement::TPtr parentPath, TOperationContext& context, bool isBackup) { + parentPath->DecAliveChildrenPrivate(isBackup); + if (parentPath->GetAliveChildren() == 0 && !parentPath->IsDomainRoot()) { + auto grandParentDir = context.SS->PathsById.at(parentPath->ParentPathId); + if (grandParentDir->IsDirectory() || grandParentDir->IsDomainRoot()) { + ++grandParentDir->DirAlterVersion; + NIceDb::TNiceDb db(context.GetDB()); + context.SS->PersistPathDirAlterVersion(db, grandParentDir); + context.SS->ClearDescribePathCaches(grandParentDir); + context.OnComplete.PublishToSchemeBoard(opId, grandParentDir->PathId); + } + } +} + NKikimrSchemeOp::TModifyScheme MoveTableTask(NKikimr::NSchemeShard::TPath& src, NKikimr::NSchemeShard::TPath& dst) { NKikimrSchemeOp::TModifyScheme scheme; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_common.h b/ydb/core/tx/schemeshard/schemeshard__operation_common.h index e6182d631d1f..9b41a0ffce86 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_common.h +++ b/ydb/core/tx/schemeshard/schemeshard__operation_common.h @@ -20,6 +20,11 @@ TSet AllIncomingEvents(); void IncParentDirAlterVersionWithRepublishSafeWithUndo(const TOperationId& opId, const TPath& path, TSchemeShard* ss, TSideEffects& onComplete); void IncParentDirAlterVersionWithRepublish(const TOperationId& opId, const TPath& path, TOperationContext& context); +void IncAliveChildrenSafeWithUndo(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup = false); +void IncAliveChildrenDirect(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup = false); +void DecAliveChildrenDirect(const TOperationId& opId, TPathElement::TPtr parentPath, TOperationContext& context, bool isBackup = false); + + NKikimrSchemeOp::TModifyScheme MoveTableTask(NKikimr::NSchemeShard::TPath& src, NKikimr::NSchemeShard::TPath& dst); NKikimrSchemeOp::TModifyScheme MoveTableIndexTask(NKikimr::NSchemeShard::TPath& src, NKikimr::NSchemeShard::TPath& dst); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_copy_sequence.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_copy_sequence.cpp index 9b81e766374e..00044c9f551c 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_copy_sequence.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_copy_sequence.cpp @@ -732,7 +732,7 @@ class TCopySequence: public TSubOperation { context.OnComplete.PublishToSchemeBoard(OperationId, dstPath->PathId); domainInfo->IncPathsInside(); - parentPath->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_copy_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_copy_table.cpp index f45f7fbbc4e5..8a2188f558bc 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_copy_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_copy_table.cpp @@ -715,7 +715,7 @@ class TCopyTable: public TSubOperation { dstPath.DomainInfo()->IncPathsInside(1, isBackup); dstPath.DomainInfo()->AddInternalShards(txState, isBackup); dstPath.Base()->IncShardsInside(shardsToCreate); - parent.Base()->IncAliveChildren(1, isBackup); + IncAliveChildrenSafeWithUndo(OperationId, parent, context, isBackup); LOG_TRACE_S(context.Ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, "TCopyTable Propose creating new table" diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_backup_collection.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_backup_collection.cpp index 7e0010243c1e..0db255e8f3ac 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_backup_collection.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_backup_collection.cpp @@ -111,11 +111,6 @@ class TCreateBackupCollection : public TSubOperation { return backupCollection; } - static void UpdatePathSizeCounts(const TPath& parentPath, const TPath& dstPath) { - dstPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); - } - public: using TSubOperation::TSubOperation; @@ -177,7 +172,7 @@ class TCreateBackupCollection : public TSubOperation { AddPathInSchemeShard(result, dstPath, owner); auto pathEl = CreateBackupCollectionPathElement(dstPath); - rootPath->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, rootPath, context); // for correct discard of ChildrenExist prop rootPath.DomainInfo()->IncPathsInside(); auto backupCollection = TBackupCollectionInfo::Create(desc); @@ -220,7 +215,8 @@ class TCreateBackupCollection : public TSubOperation { context.SS, context.OnComplete); - UpdatePathSizeCounts(rootPath, dstPath); + dstPath.DomainInfo()->IncPathsInside(); + IncAliveChildrenDirect(OperationId, rootPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_bsv.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_bsv.cpp index 7ab9b02653f3..7fc407cc4452 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_bsv.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_bsv.cpp @@ -365,7 +365,7 @@ class TCreateBlockStoreVolume: public TSubOperation { dstPath.DomainInfo()->IncPathsInside(); dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp index 05409e951742..55d2255e3461 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp @@ -325,7 +325,7 @@ class TNewCdcStream: public TSubOperation { context.SS->IncrementPathDbRefCount(pathId); streamPath.DomainInfo()->IncPathsInside(); - tablePath.Base()->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, tablePath, context); // for correct discard of ChildrenExist prop context.OnComplete.ActivateTx(OperationId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_external_data_source.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_external_data_source.cpp index 45bcc1f32a3d..39e9d548087b 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_external_data_source.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_external_data_source.cpp @@ -216,11 +216,6 @@ class TCreateExternalDataSource : public TSubOperation { context.SS->PersistTxState(db, OperationId); } - static void UpdatePathSizeCounts(const TPath& parentPath, const TPath& dstPath) { - dstPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); - } - public: using TSubOperation::TSubOperation; @@ -283,7 +278,8 @@ class TCreateExternalDataSource : public TSubOperation { context.SS, context.OnComplete); - UpdatePathSizeCounts(parentPath, dstPath); + dstPath.DomainInfo()->IncPathsInside(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp index 1663505e9e6b..b99081d05fdb 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp @@ -285,12 +285,6 @@ class TCreateExternalTable: public TSubOperation { context.SS->PersistTxState(db, OperationId); } - static void UpdatePathSizeCounts(const TPath& parentPath, - const TPath& dstPath) { - dstPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); - } - public: using TSubOperation::TSubOperation; @@ -376,7 +370,8 @@ class TCreateExternalTable: public TSubOperation { context.SS, context.OnComplete); - UpdatePathSizeCounts(parentPath, dstPath); + dstPath.DomainInfo()->IncPathsInside(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_extsubdomain.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_extsubdomain.cpp index 7abcc6d3a6cb..216b90bc911a 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_extsubdomain.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_extsubdomain.cpp @@ -262,7 +262,7 @@ class TCreateExtSubDomain: public TSubOperation { Y_ABORT_UNLESS(0 == txState.Shards.size()); parentPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp index 0bdd4b764ab5..a7aab5d81cf1 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp @@ -431,7 +431,7 @@ THolder TCreateFileStore::Propose( dstPath.DomainInfo()->IncPathsInside(); dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_index.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_index.cpp index 534bb2aaab7f..c307386c7206 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_index.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_index.cpp @@ -246,7 +246,7 @@ class TCreateTableIndex: public TSubOperation { context.OnComplete.ActivateTx(OperationId); dstPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_kesus.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_kesus.cpp index db0d4dfd3356..8b9086614045 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_kesus.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_kesus.cpp @@ -406,7 +406,7 @@ class TCreateKesus: public TSubOperation { dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_pq.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_pq.cpp index e90aa279943c..7e7f8891fe7c 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_pq.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_pq.cpp @@ -558,7 +558,7 @@ class TCreatePQ: public TSubOperation { context.SS->TabletCounters->Simple()[COUNTER_STREAM_SHARDS_COUNT].Add(StreamShardsCountChange); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_replication.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_replication.cpp index 3757009b6f21..9eb07feaca6c 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_replication.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_replication.cpp @@ -397,7 +397,7 @@ class TCreateReplication: public TSubOperation { result->SetPathId(path->PathId.LocalPathId); context.SS->IncrementPathDbRefCount(path->PathId); - parentPath->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop parentPath.DomainInfo()->IncPathsInside(); if (desc.GetConfig().GetSrcConnectionParams().GetCredentialsCase() == NKikimrReplication::TConnectionParams::CREDENTIALS_NOT_SET) { diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_resource_pool.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_resource_pool.cpp index 46a1bda49550..1ae142e14bfb 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_resource_pool.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_resource_pool.cpp @@ -138,11 +138,6 @@ class TCreateResourcePool : public TSubOperation { return resourcePool; } - static void UpdatePathSizeCounts(const TPath& parentPath, const TPath& dstPath) { - dstPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); - } - public: using TSubOperation::TSubOperation; @@ -187,7 +182,8 @@ class TCreateResourcePool : public TSubOperation { IncParentDirAlterVersionWithRepublishSafeWithUndo(OperationId, dstPath, context.SS, context.OnComplete); - UpdatePathSizeCounts(parentPath, dstPath); + dstPath.DomainInfo()->IncPathsInside(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_rtmr.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_rtmr.cpp index 4a3883dcacaa..985a8c5589ae 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_rtmr.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_rtmr.cpp @@ -372,7 +372,7 @@ class TCreateRTMR: public TSubOperation { dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_sequence.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_sequence.cpp index 64fe469e5ae4..531da899c70a 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_sequence.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_sequence.cpp @@ -577,7 +577,7 @@ class TCreateSequence : public TSubOperation { context.OnComplete.PublishToSchemeBoard(OperationId, dstPath->PathId); domainInfo->IncPathsInside(); - parentPath->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_solomon.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_solomon.cpp index 8eda2088b21b..46a24d41e6ea 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_solomon.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_solomon.cpp @@ -422,7 +422,7 @@ class TCreateSolomon: public TSubOperation { dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_subdomain.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_subdomain.cpp index 7e5acedb4f50..3651f6a97902 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_subdomain.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_subdomain.cpp @@ -344,7 +344,7 @@ class TCreateSubDomain: public TSubOperation { dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop SetState(NextState()); return result; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp index 0e82a3af4f67..1c8fcbc56963 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp @@ -728,7 +728,7 @@ class TCreateTable: public TSubOperation { dstPath.DomainInfo()->AddInternalShards(txState); dstPath.Base()->IncShardsInside(shardsToCreate); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop LOG_TRACE_S(context.Ctx, NKikimrServices::FLAT_TX_SCHEMESHARD, "TCreateTable Propose creating new table" diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_view.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_view.cpp index 470e1d1a8db9..65e26daf3ac0 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_view.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_view.cpp @@ -198,7 +198,8 @@ class TCreateView: public TSubOperation { dstPath.MaterializeLeaf(owner, viewPathId); dstPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, parentPath, context); // for correct discard of ChildrenExist prop + result->SetPathId(viewPathId.LocalPathId); TPathElement::TPtr viewPath = dstPath.Base(); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_backup_collection.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_backup_collection.cpp index 733a0dec5e6c..b0883939268d 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_backup_collection.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_backup_collection.cpp @@ -47,7 +47,7 @@ class TPropose : public TSubOperationState { auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDirPtr->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDirPtr, context); // for correct discard of ChildrenExist prop context.SS->TabletCounters->Simple()[COUNTER_BACKUP_COLLECTION_COUNT].Sub(1); ++parentDirPtr->DirAlterVersion; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_bsv.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_bsv.cpp index 849cc9dbfa6d..228da123b76d 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_bsv.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_bsv.cpp @@ -53,7 +53,7 @@ class TPropose: public TSubOperationState { context.SS->PersistDropStep(db, pathId, step, OperationId); auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop // KIKIMR-13173 // Repeat it here for a while, delete it from TDeleteParts after @@ -219,7 +219,7 @@ class TDropBlockStoreVolume: public TSubOperation { double rate = 0; double capacity = 0; auto& attrs = domainDir->UserAttrs->Attrs; - if (TryFromString(attrs[RateLimiterRateAttrName], rate) && + if (TryFromString(attrs[RateLimiterRateAttrName], rate) && TryFromString(attrs[RateLimiterCapacityAttrName], capacity)) { rateLimiter.SetRate(rate); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_cdc_stream.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_cdc_stream.cpp index 98e26d7e0098..2fc09a841abd 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_cdc_stream.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_cdc_stream.cpp @@ -68,7 +68,7 @@ class TPropose: public TSubOperationState { auto parent = context.SS->PathsById.at(path->ParentPathId); context.SS->ResolveDomainInfo(pathId)->DecPathsInside(); - parent->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parent, context); // for correct discard of ChildrenExist prop context.SS->ClearDescribePathCaches(path); context.OnComplete.PublishToSchemeBoard(OperationId, pathId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_data_source.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_data_source.cpp index 6eee14346f20..bc211d733069 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_data_source.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_data_source.cpp @@ -52,7 +52,7 @@ class TPropose: public TSubOperationState { context.SS->PersistDropStep(db, pathId, step, OperationId); auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop context.SS->TabletCounters->Simple()[COUNTER_EXTERNAL_DATA_SOURCE_COUNT].Sub(1); context.SS->PersistRemoveExternalDataSource(db, pathId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_table.cpp index df6e6917438a..ee945523f5a3 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_external_table.cpp @@ -54,7 +54,7 @@ class TPropose: public TSubOperationState { context.SS->PersistDropStep(db, pathId, step, OperationId); auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop TExternalDataSourceInfo::TPtr externalDataSourceInfo = context.SS->ExternalDataSources.Value(dataSourcePathId, nullptr); Y_ABORT_UNLESS(externalDataSourceInfo); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp index 4b662fb4c270..6428bbd31852 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_fs.cpp @@ -59,7 +59,7 @@ class TPropose: public TSubOperationState { context.SS->PersistDropStep(db, pathId, step, OperationId); auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop // KIKIMR-13173 // Repeat it here for a while, delete it from TDeleteParts after diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_indexed_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_indexed_table.cpp index f643fbae9df8..9b1ce9c0d69d 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_indexed_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_indexed_table.cpp @@ -40,7 +40,7 @@ void DropPath(NIceDb::TNiceDb& db, TOperationContext& context, domainInfo->DecPathsInside(); auto parentDir = path.Parent(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(operationId, parentDir.Base(), context); // for correct discard of ChildrenExist prop ++parentDir->DirAlterVersion; context.SS->PersistPathDirAlterVersion(db, parentDir.Base()); @@ -427,7 +427,7 @@ TVector CreateDropIndexedTable(TOperationId nextId, const T .NotUnderDeleting() .NotUnderOperation(); if (!table.Parent()->IsTableIndex() || !NTableIndex::IsBuildImplTable(table.LeafName())) { - checks.IsCommonSensePath(); + checks.IsCommonSensePath(); } } } diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_kesus.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_kesus.cpp index f1476ead9642..00bdd7219b52 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_kesus.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_kesus.cpp @@ -51,7 +51,7 @@ class TPropose: public TSubOperationState { context.SS->PersistDropStep(db, pathId, step, OperationId); auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop // KIKIMR-13173 // Repeat it here for a while, delete it from TDeleteParts after diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp index e96f73c403bc..29a73c1fd9c7 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp @@ -205,7 +205,7 @@ class TPropose: public TSubOperationState { context.SS->TabletCounters->Simple()[COUNTER_STREAM_SHARDS_COUNT].Sub(pqGroup->TotalPartitionCount); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop if (!AppData()->DisableSchemeShardCleanupOnDropForTest) { context.SS->PersistRemovePersQueueGroup(db, pathId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_replication.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_replication.cpp index 41e48e6cf8e0..d7b374cb7952 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_replication.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_replication.cpp @@ -202,7 +202,7 @@ class TPropose: public TSubOperationState { context.SS->TabletCounters->Simple()[COUNTER_REPLICATION_COUNT].Add(-1); context.SS->ResolveDomainInfo(pathId)->DecPathsInside(); - parentPath->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop ++parentPath->DirAlterVersion; context.SS->PersistPathDirAlterVersion(db, parentPath); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_resource_pool.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_resource_pool.cpp index 49e4e0e2b11e..4c42f0969108 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_resource_pool.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_resource_pool.cpp @@ -24,7 +24,7 @@ class TPropose : public TSubOperationState { const TPathId& pathId = txState->TargetPathId; const TPathElement::TPtr pathPtr = context.SS->PathsById.at(pathId); const TPathElement::TPtr parentDirPtr = context.SS->PathsById.at(pathPtr->ParentPathId); - + NIceDb::TNiceDb db(context.GetDB()); Y_ABORT_UNLESS(!pathPtr->Dropped()); @@ -34,7 +34,7 @@ class TPropose : public TSubOperationState { auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDirPtr->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDirPtr, context); // for correct discard of ChildrenExist prop context.SS->TabletCounters->Simple()[COUNTER_RESOURCE_POOL_COUNT].Sub(1); ++parentDirPtr->DirAlterVersion; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_sequence.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_sequence.cpp index eceba236443e..790bff09fe27 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_sequence.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_sequence.cpp @@ -171,7 +171,7 @@ class TPropose: public TSubOperationState { auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop context.SS->TabletCounters->Simple()[COUNTER_USER_ATTRIBUTES_COUNT].Add(-path->UserAttrs->Size()); context.SS->PersistUserAttributes(db, path->PathId, path->UserAttrs, nullptr); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_table.cpp index f37689e528c6..9ab828b9003b 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_table.cpp @@ -42,7 +42,7 @@ void DropPath(NIceDb::TNiceDb& db, domainInfo->DecPathsInside(1, isBackupTable); auto parentDir = path.Parent(); - parentDir->DecAliveChildren(1, isBackupTable); + DecAliveChildrenDirect(operationId, parentDir.Base(), context, isBackupTable); ++parentDir->DirAlterVersion; context.SS->PersistPathDirAlterVersion(db, parentDir.Base()); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_view.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_view.cpp index 0d2c2e21a38c..a9f1f8cd04c6 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_view.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_view.cpp @@ -57,7 +57,7 @@ class TPropose: public TSubOperationState { context.SS->PersistDropStep(db, pathId, step, OperationId); auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop context.SS->TabletCounters->Simple()[COUNTER_VIEW_COUNT].Sub(1); context.SS->PersistRemoveView(db, pathId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_mkdir.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_mkdir.cpp index 22d527530aa6..7c2ef6b2ccfe 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_mkdir.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_mkdir.cpp @@ -260,7 +260,7 @@ class TMkDir: public TSubOperation { } dstPath.DomainInfo()->IncPathsInside(); - parentPath.Base()->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, parentPath, context); // for correct discard of ChildrenExist prop context.OnComplete.ActivateTx(OperationId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_move_sequence.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_move_sequence.cpp index a08972ade11a..92a876486d9a 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_move_sequence.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_move_sequence.cpp @@ -22,7 +22,7 @@ void MarkSrcDropped(NIceDb::TNiceDb& db, srcPath->SetDropped(txState.PlanStep, operationId.GetTxId()); context.SS->PersistDropStep(db, srcPath->PathId, txState.PlanStep, operationId); - srcPath.Parent()->DecAliveChildren(); + DecAliveChildrenDirect(operationId, srcPath.Parent().Base(), context); srcPath.DomainInfo()->DecPathsInside(); IncParentDirAlterVersionWithRepublish(operationId, srcPath, context); @@ -727,7 +727,7 @@ class TMoveSequence: public TSubOperation { case TTxState::ProposedMoveSequence: return TTxState::DropParts; case TTxState::DropParts: - return TTxState::Done; + return TTxState::Done; default: return TTxState::Invalid; } @@ -940,7 +940,7 @@ class TMoveSequence: public TSubOperation { dstPath->ApplyACL(acl); } - dstParentPath->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, dstParentPath, context); // for correct discard of ChildrenExist prop srcPath.Base()->PathState = TPathElement::EPathState::EPathStateMoving; srcPath.Base()->LastTxId = OperationId.GetTxId(); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_move_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_move_table.cpp index f51bdcc97667..110bb7febd21 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_move_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_move_table.cpp @@ -143,7 +143,7 @@ void MarkSrcDropped(NIceDb::TNiceDb& db, TPath& srcPath) { const auto isBackupTable = context.SS->IsBackupTable(srcPath->PathId); - srcPath.Parent()->DecAliveChildren(1, isBackupTable); + DecAliveChildrenDirect(operationId, srcPath.Parent().Base(), context, isBackupTable); srcPath.DomainInfo()->DecPathsInside(1, isBackupTable); srcPath->SetDropped(txState.PlanStep, operationId.GetTxId()); @@ -709,7 +709,7 @@ class TMoveTable: public TSubOperation { dstPath.Base()->UserAttrs->AlterData = srcPath.Base()->UserAttrs; dstPath.Base()->ACL = srcPath.Base()->ACL; - dstParent.Base()->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, dstParent, context); // for correct discard of ChildrenExist prop // create tx state, do not catch shards right now TTxState& txState = context.SS->CreateTx(OperationId, TTxState::TxMoveTable, dstPath.Base()->PathId, srcPath.Base()->PathId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_move_table_index.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_move_table_index.cpp index 84b10023b850..39995c90f32e 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_move_table_index.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_move_table_index.cpp @@ -21,7 +21,7 @@ void MarkSrcDropped(NIceDb::TNiceDb& db, context.SS->PersistRemoveTable(db, srcPath->PathId, context.Ctx); context.SS->PersistUserAttributes(db, srcPath->PathId, srcPath->UserAttrs, nullptr); - srcPath.Parent()->DecAliveChildren(); + DecAliveChildrenDirect(operationId, srcPath.Parent().Base(), context); srcPath.DomainInfo()->DecPathsInside(); IncParentDirAlterVersionWithRepublish(operationId, srcPath, context); @@ -502,7 +502,7 @@ class TMoveTableIndex: public TSubOperation { dstPath.Base()->UserAttrs->AlterData = srcPath.Base()->UserAttrs; dstPath.Base()->ACL = srcPath.Base()->ACL; - dstParentPath.Base()->IncAliveChildren(); + IncAliveChildrenSafeWithUndo(OperationId, dstParentPath, context); // for correct discard of ChildrenExist prop // create tx state, do not catch shards right now TTxState& txState = context.SS->CreateTx(OperationId, TTxState::TxMoveTableIndex, dstPath.Base()->PathId, srcPath.Base()->PathId); diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_rmdir.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_rmdir.cpp index dce298dc57b6..71392600d7a5 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_rmdir.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_rmdir.cpp @@ -1,4 +1,5 @@ #include "schemeshard__operation_part.h" +#include "schemeshard__operation_common.h" #include "schemeshard_impl.h" #include "schemeshard_private.h" @@ -158,7 +159,7 @@ class TRmDir: public TSubOperationBase { context.SS->PersistDropStep(db, pathId, step, OperationId); auto domainInfo = context.SS->ResolveDomainInfo(pathId); domainInfo->DecPathsInside(); - parentDir->DecAliveChildren(); + DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop ++parentDir->DirAlterVersion; context.SS->PersistPathDirAlterVersion(db, parentDir); diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index 79f8987d3f2d..a976e60cf531 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -5145,7 +5145,7 @@ void TSchemeShard::UncountNode(TPathElement::TPtr node) { } else { ResolveDomainInfo(node)->DecPathsInside(1, isBackupTable); } - PathsById.at(node->ParentPathId)->DecAliveChildren(1, isBackupTable); + PathsById.at(node->ParentPathId)->DecAliveChildrenPrivate(isBackupTable); TabletCounters->Simple()[COUNTER_USER_ATTRIBUTES_COUNT].Sub(node->UserAttrs->Size()); diff --git a/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp b/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp index cd40e51a8a99..a783a093d618 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_path_describer.cpp @@ -176,6 +176,8 @@ void TPathDescriber::FillChildDescr(NKikimrSchemeOp::TDirEntry* descr, TPathElem descr->SetCreateStep(ui64(pathEl->StepCreated)); } + descr->SetChildrenExist(pathEl->GetAliveChildren() > 0); + if (pathEl->PathType == NKikimrSchemeOp::EPathTypePersQueueGroup) { auto it = Self->Topics.FindPtr(pathEl->PathId); Y_ABORT_UNLESS(it, "PersQueueGroup is not found"); diff --git a/ydb/core/tx/schemeshard/schemeshard_path_element.cpp b/ydb/core/tx/schemeshard/schemeshard_path_element.cpp index d8ee3e2c3b62..8a6e7bc87315 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_element.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_path_element.cpp @@ -59,31 +59,27 @@ ui64 TPathElement::GetAliveChildren() const { return AliveChildrenCount; } -void TPathElement::SetAliveChildren(ui64 val) { - AliveChildrenCount = val; -} - ui64 TPathElement::GetBackupChildren() const { return BackupChildrenCount; } -void TPathElement::IncAliveChildren(ui64 delta, bool isBackup) { - Y_ABORT_UNLESS(Max() - AliveChildrenCount >= delta); - AliveChildrenCount += delta; +void TPathElement::IncAliveChildrenPrivate(bool isBackup) { + Y_ABORT_UNLESS(Max() - AliveChildrenCount >= 1); + AliveChildrenCount += 1; if (isBackup) { - Y_ABORT_UNLESS(Max() - BackupChildrenCount >= delta); - BackupChildrenCount += delta; + Y_ABORT_UNLESS(Max() - BackupChildrenCount >= 1); + BackupChildrenCount += 1; } } -void TPathElement::DecAliveChildren(ui64 delta, bool isBackup) { - Y_ABORT_UNLESS(AliveChildrenCount >= delta); - AliveChildrenCount -= delta; +void TPathElement::DecAliveChildrenPrivate(bool isBackup) { + Y_ABORT_UNLESS(AliveChildrenCount >= 1); + AliveChildrenCount -= 1; if (isBackup) { - Y_ABORT_UNLESS(BackupChildrenCount >= delta); - BackupChildrenCount -= delta; + Y_ABORT_UNLESS(BackupChildrenCount >= 1); + BackupChildrenCount -= 1; } } diff --git a/ydb/core/tx/schemeshard/schemeshard_path_element.h b/ydb/core/tx/schemeshard/schemeshard_path_element.h index b9308cc8851e..e60f61944803 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_element.h +++ b/ydb/core/tx/schemeshard/schemeshard_path_element.h @@ -101,10 +101,9 @@ struct TPathElement : TSimpleRefCount { public: TPathElement(TPathId pathId, TPathId parentPathId, TPathId domainPathId, const TString& name, const TString& owner); ui64 GetAliveChildren() const; - void SetAliveChildren(ui64 val); + void IncAliveChildrenPrivate(bool isBackup = false); + void DecAliveChildrenPrivate(bool isBackup = false); ui64 GetBackupChildren() const; - void IncAliveChildren(ui64 delta = 1, bool isBackup = false); - void DecAliveChildren(ui64 delta = 1, bool isBackup = false); ui64 GetShardsInside() const; void SetShardsInside(ui64 val); void IncShardsInside(ui64 delta = 1); diff --git a/ydb/core/tx/schemeshard/ut_base/ut_base.cpp b/ydb/core/tx/schemeshard/ut_base/ut_base.cpp index 90589ff7386e..548a735cea00 100644 --- a/ydb/core/tx/schemeshard/ut_base/ut_base.cpp +++ b/ydb/core/tx/schemeshard/ut_base/ut_base.cpp @@ -74,7 +74,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), {NLs::Finished, - NLs::PathVersionEqual(5)}); + NLs::PathVersionEqual(6)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB"), {NLs::Finished, NLs::PathVersionEqual(3)}); @@ -844,7 +844,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot"), {NLs::ChildrenCount(1)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), - {NLs::PathVersionEqual(13), + {NLs::PathVersionEqual(14), NLs::ChildrenCount(5)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/Table1"), @@ -1119,7 +1119,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { env.TestWaitNotification(runtime, {txId, txId-1 , txId-2}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), - {NLs::PathVersionEqual(7), + {NLs::PathVersionEqual(8), NLs::Finished, NLs::PathExist, NLs::PathsInsideDomain(9), @@ -1149,7 +1149,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { NLs::Finished}); auto dirAVersion = TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), - {NLs::PathVersionEqual(11), + {NLs::PathVersionEqual(13), NLs::PathExist, NLs::Finished, NLs::PathExist, @@ -1169,7 +1169,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { env.TestWaitNotification(runtime, txId); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), - {NLs::PathVersionEqual(15), + {NLs::PathVersionEqual(18), NLs::PathExist, NLs::Finished, NLs::PathsInsideDomain(25), @@ -1245,7 +1245,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { env.TestWaitNotification(runtime, txId); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), - {NLs::PathVersionEqual(19), + {NLs::PathVersionEqual(22), NLs::PathExist, NLs::Finished, NLs::PathsInsideDomain(27), @@ -1816,7 +1816,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/Table1"), {NLs::Finished, @@ -2361,12 +2361,12 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); auto dirAVersion = TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1), NLs::ShardsInsideDomain(3)}); @@ -2375,7 +2375,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot"), {NLs::Finished, - NLs::PathVersionEqual(7), + NLs::PathVersionEqual(8), NLs::ChildrenCount(0)}); env.TestWaitTabletDeletion(runtime, xrange(TTestTxConfig::FakeHiveTablets, TTestTxConfig::FakeHiveTablets + 5)); @@ -2451,7 +2451,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { auto dirAVersion = TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); AsyncDropTable(runtime, ++txId, "/MyRoot/DirA", "Table1"); @@ -2809,11 +2809,11 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { NLs::NoChildren}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/SubDirA"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/SubDirA/AAA"), {NLs::Finished, @@ -10353,7 +10353,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/Dir"), {NLs::NotFinished, - NLs::PathVersionEqual(3), + NLs::PathVersionEqual(4), NLs::ChildrenCount(1)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/Dir/Table"), @@ -10387,7 +10387,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/Dir"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/Dir/Table"), diff --git a/ydb/core/tx/schemeshard/ut_reboots/ut_reboots.cpp b/ydb/core/tx/schemeshard/ut_reboots/ut_reboots.cpp index fffa33bf102c..f978825b9ec8 100644 --- a/ydb/core/tx/schemeshard/ut_reboots/ut_reboots.cpp +++ b/ydb/core/tx/schemeshard/ut_reboots/ut_reboots.cpp @@ -390,7 +390,7 @@ Y_UNIT_TEST_SUITE(TConsistentOpsWithReboots) { TInactiveZone inactive(activeZone); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB"), { NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB/Table1"), { NLs::Finished, @@ -464,7 +464,7 @@ Y_UNIT_TEST_SUITE(TConsistentOpsWithReboots) { TInactiveZone inactive(activeZone); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB"), {NLs::Finished, - NLs::PathVersionEqual(7), + NLs::PathVersionEqual(9), NLs::ChildrenCount(0)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB/Table1"), {NLs::PathNotExist}); @@ -508,7 +508,7 @@ Y_UNIT_TEST_SUITE(TConsistentOpsWithReboots) { dirAVersion = TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); } @@ -601,7 +601,7 @@ Y_UNIT_TEST_SUITE(TConsistentOpsWithReboots) { dirAVersion = TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB"), {NLs::Finished, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::ChildrenCount(1)}); } @@ -617,7 +617,7 @@ Y_UNIT_TEST_SUITE(TConsistentOpsWithReboots) { TInactiveZone inactive(activeZone); TestDescribeResult(DescribePath(runtime, "/MyRoot"), {NLs::Finished, - NLs::PathVersionOneOf({8, 9}), + NLs::PathVersionOneOf({10, 11}), NLs::ChildrenCount(1)}); } }); diff --git a/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp b/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp index 3e2f37780d8a..60de0f783f28 100644 --- a/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp +++ b/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp @@ -529,7 +529,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::IsSubDomain("USER_0"), - NLs::PathVersionEqual(7), + NLs::PathVersionEqual(8), NLs::PathsInsideDomain(3), NLs::ShardsInsideDomain(4)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0/table_0"), @@ -1238,7 +1238,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, {100, 101, 102}); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {LsCheckSubDomainParamsInMassiveCase("USER_0"), - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::PathsInsideDomain(2), NLs::ShardsInsideDomain(7)}); @@ -2190,7 +2190,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, {txId - 1, txId - 2, txId -3}); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(2), NLs::ShardsInsideDomain(2)}); @@ -2201,7 +2201,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, {txId - 1, txId - 2}); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(5), + NLs::PathVersionEqual(6), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards, lowLimits.MaxPQPartitions), NLs::PathsInsideDomain(3), NLs::ShardsInsideDomain(2), @@ -2215,7 +2215,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, txId - 1); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(7), + NLs::PathVersionEqual(8), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2261,7 +2261,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, txId - 1); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(10), + NLs::PathVersionEqual(12), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2363,7 +2363,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, txId - 1); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(14), + NLs::PathVersionEqual(17), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2409,7 +2409,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, txId - 1); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(18), + NLs::PathVersionEqual(21), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2439,7 +2439,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, txId - 1); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(23), + NLs::PathVersionEqual(26), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2486,7 +2486,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { env.TestWaitNotification(runtime, txId - 1); TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(27), + NLs::PathVersionEqual(31), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2507,7 +2507,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(27), + NLs::PathVersionEqual(31), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2524,7 +2524,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(27), + NLs::PathVersionEqual(31), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(0), NLs::ShardsInsideDomain(2)}); @@ -2542,7 +2542,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(29), + NLs::PathVersionEqual(33), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(1), NLs::ShardsInsideDomain(4)}); @@ -2559,7 +2559,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(29), + NLs::PathVersionEqual(33), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(1), NLs::ShardsInsideDomain(5)}); @@ -2576,7 +2576,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {NLs::PathExist, - NLs::PathVersionEqual(29), + NLs::PathVersionEqual(33), NLs::DomainLimitsIs(lowLimits.MaxPaths, lowLimits.MaxShards), NLs::PathsInsideDomain(1), NLs::ShardsInsideDomain(5)}); diff --git a/ydb/core/tx/schemeshard/ut_subdomain_reboots/ut_subdomain_reboots.cpp b/ydb/core/tx/schemeshard/ut_subdomain_reboots/ut_subdomain_reboots.cpp index f8aca4e30713..6100f9f10f62 100644 --- a/ydb/core/tx/schemeshard/ut_subdomain_reboots/ut_subdomain_reboots.cpp +++ b/ydb/core/tx/schemeshard/ut_subdomain_reboots/ut_subdomain_reboots.cpp @@ -670,7 +670,7 @@ Y_UNIT_TEST_SUITE(ForceDropWithReboots) { t.TestEnv->TestWaitNotification(runtime, {t.TxId-2, t.TxId-1, t.TxId} ); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/USER_0"), - {NLs::PathVersionEqual(5), + {NLs::PathVersionEqual(6), NLs::PathsInsideDomain(2), NLs::ShardsInsideDomain(3)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), diff --git a/ydb/core/tx/schemeshard/ut_user_attributes/ut_user_attributes.cpp b/ydb/core/tx/schemeshard/ut_user_attributes/ut_user_attributes.cpp index 48a63f877e31..32b27f341c8c 100644 --- a/ydb/core/tx/schemeshard/ut_user_attributes/ut_user_attributes.cpp +++ b/ydb/core/tx/schemeshard/ut_user_attributes/ut_user_attributes.cpp @@ -29,7 +29,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardUserAttrsTest) { TestDescribeResult(DescribePath(runtime, "/MyRoot"), {NLs::Finished}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA"), - {NLs::Finished, NLs::UserAttrsEqual(dirAAttrs), NLs::PathVersionEqual(5)}); + {NLs::Finished, NLs::UserAttrsEqual(dirAAttrs), NLs::PathVersionEqual(6)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirB"), {NLs::Finished, NLs::UserAttrsEqual(dirBAttrs), NLs::PathVersionEqual(3)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/DirA/SubDirA"), diff --git a/ydb/core/tx/schemeshard/ut_user_attributes_reboots/ut_user_attributes_reboots.cpp b/ydb/core/tx/schemeshard/ut_user_attributes_reboots/ut_user_attributes_reboots.cpp index 8b58b94b0d7d..a3315ab6166a 100644 --- a/ydb/core/tx/schemeshard/ut_user_attributes_reboots/ut_user_attributes_reboots.cpp +++ b/ydb/core/tx/schemeshard/ut_user_attributes_reboots/ut_user_attributes_reboots.cpp @@ -36,7 +36,7 @@ Y_UNIT_TEST_SUITE(TUserAttrsTestWithReboots) { NLs::UserAttrsEqual(userAttrs)}); } - t.TestEnv->ReliablePropose(runtime, UserAttrsRequest(++t.TxId, "/MyRoot/DirA", "USER_0", + t.TestEnv->ReliablePropose(runtime, UserAttrsRequest(++t.TxId, "/MyRoot/DirA", "USER_0", AlterUserAttrs({}, userAttrsKeys), {pathVer}), {NKikimrScheme::StatusAccepted, NKikimrScheme::StatusMultipleModifications, NKikimrScheme::StatusPreconditionFailed}); t.TestEnv->TestWaitNotification(runtime, t.TxId); @@ -140,7 +140,7 @@ Y_UNIT_TEST_SUITE(TUserAttrsTestWithReboots) { { TInactiveZone inactive(activeZone); TestDescribeResult(DescribePath(runtime, "/MyRoot"), - {NLs::PathVersionEqual(11)}); + {NLs::PathVersionEqual(12)}); TestDescribeResult(DescribePath(runtime, "/MyRoot/Dir@"), {NLs::Finished, NLs::PathVersionEqual(5)});