Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24-3: Fix GetAliveChildren with filter by type #9934

Merged
Merged
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
4 changes: 4 additions & 0 deletions ydb/core/tx/schemeshard/schemeshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4269,6 +4269,10 @@ ui64 TSchemeShard::GetAliveChildren(TPathElement::TPtr pathEl, const std::option
Y_ABORT_UNLESS(PathsById.contains(pathId));
auto childPath = PathsById.at(pathId);

if (childPath->Dropped()) {
continue;
}

count += ui64(childPath->PathType == *type);
}

Expand Down
30 changes: 30 additions & 0 deletions ydb/core/tx/schemeshard/ut_index_build/ut_index_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,36 @@ Y_UNIT_TEST_SUITE(IndexBuildTest) {
env.TestWaitNotification(runtime, {txId, txId - 1});
}

Y_UNIT_TEST(CheckLimitWithDroppedIndex) {
TTestBasicRuntime runtime;
TTestEnv env(runtime);
ui64 txId = 100;

TSchemeLimits lowLimits;
lowLimits.MaxTableIndices = 1;
SetSchemeshardSchemaLimits(runtime, lowLimits);

TestCreateTable(runtime, ++txId, "/MyRoot", R"(
Name: "Table"
Columns { Name: "key" Type: "Uint64" }
Columns { Name: "value" Type: "Utf8" }
KeyColumnNames: ["key"]
)");
env.TestWaitNotification(runtime, txId);

TestBuildIndex(runtime, ++txId, TTestTxConfig::SchemeShard, "/MyRoot", "/MyRoot/Table", "Index1", {"value"}, Ydb::StatusIds::SUCCESS);
env.TestWaitNotification(runtime, txId);

TestDropTableIndex(runtime, ++txId, "/MyRoot", R"(
TableName: "Table"
IndexName: "Index1"
)");
env.TestWaitNotification(runtime, txId);

TestBuildIndex(runtime, ++txId, TTestTxConfig::SchemeShard, "/MyRoot", "/MyRoot/Table", "Index2", {"value"}, Ydb::StatusIds::SUCCESS);
env.TestWaitNotification(runtime, txId);
}

Y_UNIT_TEST(Lock) {
TTestBasicRuntime runtime;
TTestEnv env(runtime);
Expand Down
Loading