Skip to content

Commit 0fd4bda

Browse files
authored
return grandchildren flag (#13307)
1 parent 3c12dfd commit 0fd4bda

File tree

59 files changed

+170
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+170
-137
lines changed

ydb/core/protos/flat_scheme_op.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,7 @@ message TDirEntry {
18621862
optional uint64 PathVersion = 13;
18631863
optional EPathSubType PathSubType = 14;
18641864
optional TPathVersion Version = 15;
1865+
optional bool ChildrenExist = 16;
18651866

18661867
optional uint64 BalancerTabletID = 999; //temporary optimization for old PQ read/write protocol. Must be removed later
18671868
}

ydb/core/tx/schemeshard/olap/operations/create_store.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class TCreateOlapStore: public TSubOperation {
503503
dstPath.DomainInfo()->IncPathsInside();
504504
dstPath.DomainInfo()->AddInternalShards(txState);
505505
dstPath.Base()->IncShardsInside(shardsToCreate);
506-
parentPath.Base()->IncAliveChildren();
506+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
507507

508508
SetState(NextState());
509509
return result;

ydb/core/tx/schemeshard/olap/operations/create_table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ class TCreateColumnTable: public TSubOperation {
866866
dstPath.DomainInfo()->AddInternalShards(txState);
867867
dstPath.Base()->IncShardsInside(tableInfo->GetOwnedColumnShardsVerified().size());
868868
}
869-
parentPath.Base()->IncAliveChildren();
869+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
870870

871871
SetState(NextState(!!storeInfo));
872872
return result;

ydb/core/tx/schemeshard/olap/operations/drop_store.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class TPropose: public TSubOperationState {
9393

9494
auto domainInfo = context.SS->ResolveDomainInfo(pathId);
9595
domainInfo->DecPathsInside();
96-
parentDir->DecAliveChildren();
96+
DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop
9797

9898
context.SS->TabletCounters->Simple()[COUNTER_USER_ATTRIBUTES_COUNT].Sub(path->UserAttrs->Size());
9999
context.SS->PersistUserAttributes(db, path->PathId, path->UserAttrs, nullptr);

ydb/core/tx/schemeshard/olap/operations/drop_table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class TPropose: public TSubOperationState {
132132

133133
auto domainInfo = context.SS->ResolveDomainInfo(pathId);
134134
domainInfo->DecPathsInside();
135-
parentDir->DecAliveChildren();
135+
DecAliveChildrenDirect(OperationId, parentDir, context); // for correct discard of ChildrenExist prop
136136

137137
context.SS->TabletCounters->Simple()[COUNTER_USER_ATTRIBUTES_COUNT].Sub(path->UserAttrs->Size());
138138
context.SS->PersistUserAttributes(db, path->PathId, path->UserAttrs, nullptr);

ydb/core/tx/schemeshard/schemeshard__init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4114,7 +4114,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {
41144114

41154115
if (!path->IsRoot()) {
41164116
const bool isBackupTable = Self->IsBackupTable(item.first);
4117-
parent->IncAliveChildren(1, isBackupTable);
4117+
parent->IncAliveChildrenPrivate(isBackupTable);
41184118
inclusiveDomainInfo->IncPathsInside(1, isBackupTable);
41194119
}
41204120

ydb/core/tx/schemeshard/schemeshard__operation_blob_depot.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ namespace NKikimr::NSchemeShard {
9393

9494
return !txState->ShardsInProgress;
9595
}
96-
96+
9797
TString DebugHint() const override {
9898
return TStringBuilder() << "TConfigureBlobDepotParts id# " << OperationId;
9999
}
@@ -377,10 +377,10 @@ namespace NKikimr::NSchemeShard {
377377
dstPath.DomainInfo()->IncPathsInside();
378378
dstPath.DomainInfo()->AddInternalShards(txState);
379379
dstPath->IncShardsInside();
380-
parentPath->IncAliveChildren();
380+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
381381

382382
SetState(TTxState::CreateParts);
383-
383+
384384
auto resp = MakeHolder<TProposeResponse>(NKikimrScheme::StatusAccepted, txId, ssId);
385385
resp->SetPathId(pathId.LocalPathId);
386386
return resp;

ydb/core/tx/schemeshard/schemeshard__operation_common.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,54 @@ void IncParentDirAlterVersionWithRepublish(const TOperationId& opId, const TPath
11701170
}
11711171
}
11721172

1173+
void IncAliveChildrenSafeWithUndo(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup) {
1174+
parentPath.Base()->IncAliveChildrenPrivate(isBackup);
1175+
if (parentPath.Base()->GetAliveChildren() == 1 && !parentPath.Base()->IsDomainRoot()) {
1176+
auto grandParent = parentPath.Parent();
1177+
if (grandParent.Base()->IsLikeDirectory()) {
1178+
++grandParent.Base()->DirAlterVersion;
1179+
context.MemChanges.GrabPath(context.SS, grandParent.Base()->PathId);
1180+
context.DbChanges.PersistPath(grandParent.Base()->PathId);
1181+
}
1182+
1183+
if (grandParent.IsActive()) {
1184+
context.SS->ClearDescribePathCaches(grandParent.Base());
1185+
context.OnComplete.PublishToSchemeBoard(opId, grandParent->PathId);
1186+
}
1187+
}
1188+
}
1189+
1190+
void IncAliveChildrenDirect(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup) {
1191+
parentPath.Base()->IncAliveChildrenPrivate(isBackup);
1192+
if (parentPath.Base()->GetAliveChildren() == 1 && !parentPath.Base()->IsDomainRoot()) {
1193+
auto grandParent = parentPath.Parent();
1194+
if (grandParent.Base()->IsLikeDirectory()) {
1195+
++grandParent.Base()->DirAlterVersion;
1196+
NIceDb::TNiceDb db(context.GetDB());
1197+
context.SS->PersistPathDirAlterVersion(db, grandParent.Base());
1198+
}
1199+
1200+
if (grandParent.IsActive()) {
1201+
context.SS->ClearDescribePathCaches(grandParent.Base());
1202+
context.OnComplete.PublishToSchemeBoard(opId, grandParent->PathId);
1203+
}
1204+
}
1205+
}
1206+
1207+
void DecAliveChildrenDirect(const TOperationId& opId, TPathElement::TPtr parentPath, TOperationContext& context, bool isBackup) {
1208+
parentPath->DecAliveChildrenPrivate(isBackup);
1209+
if (parentPath->GetAliveChildren() == 0 && !parentPath->IsDomainRoot()) {
1210+
auto grandParentDir = context.SS->PathsById.at(parentPath->ParentPathId);
1211+
if (grandParentDir->IsLikeDirectory()) {
1212+
++grandParentDir->DirAlterVersion;
1213+
NIceDb::TNiceDb db(context.GetDB());
1214+
context.SS->PersistPathDirAlterVersion(db, grandParentDir);
1215+
context.SS->ClearDescribePathCaches(grandParentDir);
1216+
context.OnComplete.PublishToSchemeBoard(opId, grandParentDir->PathId);
1217+
}
1218+
}
1219+
}
1220+
11731221
NKikimrSchemeOp::TModifyScheme MoveTableTask(NKikimr::NSchemeShard::TPath& src, NKikimr::NSchemeShard::TPath& dst) {
11741222
NKikimrSchemeOp::TModifyScheme scheme;
11751223

ydb/core/tx/schemeshard/schemeshard__operation_common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ TSet<ui32> AllIncomingEvents();
2020
void IncParentDirAlterVersionWithRepublishSafeWithUndo(const TOperationId& opId, const TPath& path, TSchemeShard* ss, TSideEffects& onComplete);
2121
void IncParentDirAlterVersionWithRepublish(const TOperationId& opId, const TPath& path, TOperationContext& context);
2222

23+
void IncAliveChildrenSafeWithUndo(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup = false);
24+
void IncAliveChildrenDirect(const TOperationId& opId, const TPath& parentPath, TOperationContext& context, bool isBackup = false);
25+
void DecAliveChildrenDirect(const TOperationId& opId, TPathElement::TPtr parentPath, TOperationContext& context, bool isBackup = false);
26+
27+
2328
NKikimrSchemeOp::TModifyScheme MoveTableTask(NKikimr::NSchemeShard::TPath& src, NKikimr::NSchemeShard::TPath& dst);
2429
NKikimrSchemeOp::TModifyScheme MoveTableIndexTask(NKikimr::NSchemeShard::TPath& src, NKikimr::NSchemeShard::TPath& dst);
2530

ydb/core/tx/schemeshard/schemeshard__operation_copy_sequence.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ class TCopySequence: public TSubOperation {
732732
context.OnComplete.PublishToSchemeBoard(OperationId, dstPath->PathId);
733733

734734
domainInfo->IncPathsInside();
735-
parentPath->IncAliveChildren();
735+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
736736

737737
SetState(NextState());
738738
return result;

ydb/core/tx/schemeshard/schemeshard__operation_copy_table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ class TCopyTable: public TSubOperation {
715715
dstPath.DomainInfo()->IncPathsInside(1, isBackup);
716716
dstPath.DomainInfo()->AddInternalShards(txState, isBackup);
717717
dstPath.Base()->IncShardsInside(shardsToCreate);
718-
parent.Base()->IncAliveChildren(1, isBackup);
718+
IncAliveChildrenSafeWithUndo(OperationId, parent, context, isBackup);
719719

720720
LOG_TRACE_S(context.Ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
721721
"TCopyTable Propose creating new table"

ydb/core/tx/schemeshard/schemeshard__operation_create_backup_collection.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ class TCreateBackupCollection : public TSubOperation {
111111
return backupCollection;
112112
}
113113

114-
static void UpdatePathSizeCounts(const TPath& parentPath, const TPath& dstPath) {
115-
dstPath.DomainInfo()->IncPathsInside();
116-
parentPath.Base()->IncAliveChildren();
117-
}
118-
119114
public:
120115
using TSubOperation::TSubOperation;
121116

@@ -177,7 +172,7 @@ class TCreateBackupCollection : public TSubOperation {
177172
AddPathInSchemeShard(result, dstPath, owner);
178173
auto pathEl = CreateBackupCollectionPathElement(dstPath);
179174

180-
rootPath->IncAliveChildren();
175+
IncAliveChildrenDirect(OperationId, rootPath, context); // for correct discard of ChildrenExist prop
181176
rootPath.DomainInfo()->IncPathsInside();
182177

183178
auto backupCollection = TBackupCollectionInfo::Create(desc);
@@ -220,8 +215,6 @@ class TCreateBackupCollection : public TSubOperation {
220215
context.SS,
221216
context.OnComplete);
222217

223-
UpdatePathSizeCounts(rootPath, dstPath);
224-
225218
SetState(NextState());
226219
return result;
227220
}

ydb/core/tx/schemeshard/schemeshard__operation_create_bsv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class TCreateBlockStoreVolume: public TSubOperation {
365365
dstPath.DomainInfo()->IncPathsInside();
366366
dstPath.DomainInfo()->AddInternalShards(txState);
367367
dstPath.Base()->IncShardsInside(shardsToCreate);
368-
parentPath.Base()->IncAliveChildren();
368+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
369369

370370
SetState(NextState());
371371
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_cdc_stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class TNewCdcStream: public TSubOperation {
325325
context.SS->IncrementPathDbRefCount(pathId);
326326

327327
streamPath.DomainInfo()->IncPathsInside();
328-
tablePath.Base()->IncAliveChildren();
328+
IncAliveChildrenSafeWithUndo(OperationId, tablePath, context); // for correct discard of ChildrenExist prop
329329

330330
context.OnComplete.ActivateTx(OperationId);
331331

ydb/core/tx/schemeshard/schemeshard__operation_create_external_data_source.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,6 @@ class TCreateExternalDataSource : public TSubOperation {
216216
context.SS->PersistTxState(db, OperationId);
217217
}
218218

219-
static void UpdatePathSizeCounts(const TPath& parentPath, const TPath& dstPath) {
220-
dstPath.DomainInfo()->IncPathsInside();
221-
parentPath.Base()->IncAliveChildren();
222-
}
223-
224219
public:
225220
using TSubOperation::TSubOperation;
226221

@@ -283,7 +278,8 @@ class TCreateExternalDataSource : public TSubOperation {
283278
context.SS,
284279
context.OnComplete);
285280

286-
UpdatePathSizeCounts(parentPath, dstPath);
281+
dstPath.DomainInfo()->IncPathsInside();
282+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
287283

288284
SetState(NextState());
289285
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,6 @@ class TCreateExternalTable: public TSubOperation {
285285
context.SS->PersistTxState(db, OperationId);
286286
}
287287

288-
static void UpdatePathSizeCounts(const TPath& parentPath,
289-
const TPath& dstPath) {
290-
dstPath.DomainInfo()->IncPathsInside();
291-
parentPath.Base()->IncAliveChildren();
292-
}
293-
294288
public:
295289
using TSubOperation::TSubOperation;
296290

@@ -376,7 +370,8 @@ class TCreateExternalTable: public TSubOperation {
376370
context.SS,
377371
context.OnComplete);
378372

379-
UpdatePathSizeCounts(parentPath, dstPath);
373+
dstPath.DomainInfo()->IncPathsInside();
374+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
380375

381376
SetState(NextState());
382377
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_extsubdomain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class TCreateExtSubDomain: public TSubOperation {
262262

263263
Y_ABORT_UNLESS(0 == txState.Shards.size());
264264
parentPath.DomainInfo()->IncPathsInside();
265-
parentPath.Base()->IncAliveChildren();
265+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
266266

267267
SetState(NextState());
268268
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_fs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ THolder<TProposeResponse> TCreateFileStore::Propose(
431431
dstPath.DomainInfo()->IncPathsInside();
432432
dstPath.DomainInfo()->AddInternalShards(txState);
433433
dstPath.Base()->IncShardsInside(shardsToCreate);
434-
parentPath.Base()->IncAliveChildren();
434+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
435435

436436
SetState(NextState());
437437
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_index.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class TCreateTableIndex: public TSubOperation {
246246
context.OnComplete.ActivateTx(OperationId);
247247

248248
dstPath.DomainInfo()->IncPathsInside();
249-
parentPath.Base()->IncAliveChildren();
249+
IncAliveChildrenSafeWithUndo(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
250250

251251
SetState(NextState());
252252
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_kesus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class TCreateKesus: public TSubOperation {
406406
dstPath.DomainInfo()->AddInternalShards(txState);
407407

408408
dstPath.Base()->IncShardsInside();
409-
parentPath.Base()->IncAliveChildren();
409+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
410410

411411
SetState(NextState());
412412
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_pq.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ class TCreatePQ: public TSubOperation {
558558
context.SS->TabletCounters->Simple()[COUNTER_STREAM_SHARDS_COUNT].Add(StreamShardsCountChange);
559559

560560
dstPath.Base()->IncShardsInside(shardsToCreate);
561-
parentPath.Base()->IncAliveChildren();
561+
IncAliveChildrenSafeWithUndo(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
562562

563563
SetState(NextState());
564564
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_replication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class TCreateReplication: public TSubOperation {
397397
result->SetPathId(path->PathId.LocalPathId);
398398

399399
context.SS->IncrementPathDbRefCount(path->PathId);
400-
parentPath->IncAliveChildren();
400+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
401401
parentPath.DomainInfo()->IncPathsInside();
402402

403403
if (desc.GetConfig().GetSrcConnectionParams().GetCredentialsCase() == NKikimrReplication::TConnectionParams::CREDENTIALS_NOT_SET) {

ydb/core/tx/schemeshard/schemeshard__operation_create_resource_pool.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@ class TCreateResourcePool : public TSubOperation {
138138
return resourcePool;
139139
}
140140

141-
static void UpdatePathSizeCounts(const TPath& parentPath, const TPath& dstPath) {
142-
dstPath.DomainInfo()->IncPathsInside();
143-
parentPath.Base()->IncAliveChildren();
144-
}
145-
146141
public:
147142
using TSubOperation::TSubOperation;
148143

@@ -187,7 +182,8 @@ class TCreateResourcePool : public TSubOperation {
187182

188183
IncParentDirAlterVersionWithRepublishSafeWithUndo(OperationId, dstPath, context.SS, context.OnComplete);
189184

190-
UpdatePathSizeCounts(parentPath, dstPath);
185+
dstPath.DomainInfo()->IncPathsInside();
186+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
191187

192188
SetState(NextState());
193189
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_rtmr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class TCreateRTMR: public TSubOperation {
372372
dstPath.DomainInfo()->AddInternalShards(txState);
373373

374374
dstPath.Base()->IncShardsInside(shardsToCreate);
375-
parentPath.Base()->IncAliveChildren();
375+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
376376

377377
SetState(NextState());
378378
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_sequence.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ class TCreateSequence : public TSubOperation {
577577
context.OnComplete.PublishToSchemeBoard(OperationId, dstPath->PathId);
578578

579579
domainInfo->IncPathsInside();
580-
parentPath->IncAliveChildren();
580+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
581581

582582
SetState(NextState());
583583
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_solomon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class TCreateSolomon: public TSubOperation {
422422
dstPath.DomainInfo()->AddInternalShards(txState);
423423

424424
dstPath.Base()->IncShardsInside(shardsToCreate);
425-
parentPath.Base()->IncAliveChildren();
425+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
426426

427427
SetState(NextState());
428428
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_subdomain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class TCreateSubDomain: public TSubOperation {
344344
dstPath.DomainInfo()->AddInternalShards(txState);
345345

346346
dstPath.Base()->IncShardsInside(shardsToCreate);
347-
parentPath.Base()->IncAliveChildren();
347+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
348348

349349
SetState(NextState());
350350
return result;

ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ class TCreateTable: public TSubOperation {
728728
dstPath.DomainInfo()->AddInternalShards(txState);
729729

730730
dstPath.Base()->IncShardsInside(shardsToCreate);
731-
parentPath.Base()->IncAliveChildren();
731+
IncAliveChildrenDirect(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
732732

733733
LOG_TRACE_S(context.Ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
734734
"TCreateTable Propose creating new table"

ydb/core/tx/schemeshard/schemeshard__operation_create_view.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ class TCreateView: public TSubOperation {
198198

199199
dstPath.MaterializeLeaf(owner, viewPathId);
200200
dstPath.DomainInfo()->IncPathsInside();
201-
parentPath.Base()->IncAliveChildren();
201+
IncAliveChildrenSafeWithUndo(OperationId, parentPath, context); // for correct discard of ChildrenExist prop
202+
202203
result->SetPathId(viewPathId.LocalPathId);
203204

204205
TPathElement::TPtr viewPath = dstPath.Base();

ydb/core/tx/schemeshard/schemeshard__operation_drop_backup_collection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TPropose : public TSubOperationState {
4747

4848
auto domainInfo = context.SS->ResolveDomainInfo(pathId);
4949
domainInfo->DecPathsInside();
50-
parentDirPtr->DecAliveChildren();
50+
DecAliveChildrenDirect(OperationId, parentDirPtr, context); // for correct discard of ChildrenExist prop
5151
context.SS->TabletCounters->Simple()[COUNTER_BACKUP_COLLECTION_COUNT].Sub(1);
5252

5353
++parentDirPtr->DirAlterVersion;

0 commit comments

Comments
 (0)