Skip to content
Merged
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
57 changes: 39 additions & 18 deletions ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2907,6 +2907,26 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
runtime.DispatchEvents(options);
};

auto createTable = [&]() {
TestCreateTable(runtime, ++txId, "/MyRoot/USER_0", R"(
Name: "Table1"
Columns { Name: "key" Type: "Uint32"}
Columns { Name: "value" Type: "Utf8"}
KeyColumnNames: ["key"]
)", {NKikimrScheme::StatusAccepted});
env.TestWaitNotification(runtime, txId);
};

auto checkQuotaAndDropTable = [&]() {
TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {LsCheckDiskQuotaExceeded(true, "Table was created and data was written")});

TestDropTable(runtime, ++txId, "/MyRoot/USER_0", "Table1");
waitForSchemaChanged(1);
env.TestWaitNotification(runtime, txId);

TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {LsCheckDiskQuotaExceeded(false, "Table dropped")});
};

// Subdomain with a 1-byte data size quota
TestCreateSubDomain(runtime, ++txId, "/MyRoot", R"(
Name: "USER_0"
Expand All @@ -2931,29 +2951,30 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"),
{LsCheckDiskQuotaExceeded(false, "SubDomain created")});

// skip a single coordinator and mediator
ui64 tabletId = TTestTxConfig::FakeHiveTablets + 2;
// UpdateRow
{
createTable();

TestCreateTable(runtime, ++txId, "/MyRoot/USER_0", R"(
Name: "Table1"
Columns { Name: "key" Type: "Uint32"}
Columns { Name: "value" Type: "Utf8"}
KeyColumnNames: ["key"]
)", {NKikimrScheme::StatusAccepted});
env.TestWaitNotification(runtime, txId);
ui64 tabletId = TTestTxConfig::FakeHiveTablets + 2; // skip a single coordinator and mediator
UpdateRow(runtime, "Table1", 1, "value1", tabletId);
waitForTableStats(1);

UpdateRow(runtime, "Table1", 1, "value1", tabletId);
waitForTableStats(1);
checkQuotaAndDropTable();
}

TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"),
{LsCheckDiskQuotaExceeded(true, "Table was created and data was written")});
// WriteRow
{
createTable();

TestDropTable(runtime, ++txId, "/MyRoot/USER_0", "Table1");
waitForSchemaChanged(1);
env.TestWaitNotification(runtime, txId);
bool successIsExpected = true;
WriteRow(runtime, ++txId, "/MyRoot/USER_0/Table1", 0, 1, "value1", successIsExpected);
waitForTableStats(1);

TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"),
{LsCheckDiskQuotaExceeded(false, "Table dropped")});
successIsExpected = false;
WriteRow(runtime, ++txId, "/MyRoot/USER_0/Table1", 0, 1, "value1", successIsExpected);

checkQuotaAndDropTable();
}
}

Y_UNIT_TEST(SchemeDatabaseQuotaRejects) {
Expand Down