Skip to content

Commit 465f1c5

Browse files
authored
24-3: Fix GetAliveChildren with filter by type (#9934)
1 parent ea4f43c commit 465f1c5

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

ydb/core/tx/schemeshard/schemeshard_impl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4269,6 +4269,10 @@ ui64 TSchemeShard::GetAliveChildren(TPathElement::TPtr pathEl, const std::option
42694269
Y_ABORT_UNLESS(PathsById.contains(pathId));
42704270
auto childPath = PathsById.at(pathId);
42714271

4272+
if (childPath->Dropped()) {
4273+
continue;
4274+
}
4275+
42724276
count += ui64(childPath->PathType == *type);
42734277
}
42744278

ydb/core/tx/schemeshard/ut_index_build/ut_index_build.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,36 @@ Y_UNIT_TEST_SUITE(IndexBuildTest) {
667667
env.TestWaitNotification(runtime, {txId, txId - 1});
668668
}
669669

670+
Y_UNIT_TEST(CheckLimitWithDroppedIndex) {
671+
TTestBasicRuntime runtime;
672+
TTestEnv env(runtime);
673+
ui64 txId = 100;
674+
675+
TSchemeLimits lowLimits;
676+
lowLimits.MaxTableIndices = 1;
677+
SetSchemeshardSchemaLimits(runtime, lowLimits);
678+
679+
TestCreateTable(runtime, ++txId, "/MyRoot", R"(
680+
Name: "Table"
681+
Columns { Name: "key" Type: "Uint64" }
682+
Columns { Name: "value" Type: "Utf8" }
683+
KeyColumnNames: ["key"]
684+
)");
685+
env.TestWaitNotification(runtime, txId);
686+
687+
TestBuildIndex(runtime, ++txId, TTestTxConfig::SchemeShard, "/MyRoot", "/MyRoot/Table", "Index1", {"value"}, Ydb::StatusIds::SUCCESS);
688+
env.TestWaitNotification(runtime, txId);
689+
690+
TestDropTableIndex(runtime, ++txId, "/MyRoot", R"(
691+
TableName: "Table"
692+
IndexName: "Index1"
693+
)");
694+
env.TestWaitNotification(runtime, txId);
695+
696+
TestBuildIndex(runtime, ++txId, TTestTxConfig::SchemeShard, "/MyRoot", "/MyRoot/Table", "Index2", {"value"}, Ydb::StatusIds::SUCCESS);
697+
env.TestWaitNotification(runtime, txId);
698+
}
699+
670700
Y_UNIT_TEST(Lock) {
671701
TTestBasicRuntime runtime;
672702
TTestEnv env(runtime);

0 commit comments

Comments
 (0)