Skip to content

Commit 653229b

Browse files
authored
WriteRow out of space (#665)
1 parent dc0ac0a commit 653229b

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp

+39-18
Original file line numberDiff line numberDiff line change
@@ -2907,6 +2907,26 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
29072907
runtime.DispatchEvents(options);
29082908
};
29092909

2910+
auto createTable = [&]() {
2911+
TestCreateTable(runtime, ++txId, "/MyRoot/USER_0", R"(
2912+
Name: "Table1"
2913+
Columns { Name: "key" Type: "Uint32"}
2914+
Columns { Name: "value" Type: "Utf8"}
2915+
KeyColumnNames: ["key"]
2916+
)", {NKikimrScheme::StatusAccepted});
2917+
env.TestWaitNotification(runtime, txId);
2918+
};
2919+
2920+
auto checkQuotaAndDropTable = [&]() {
2921+
TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {LsCheckDiskQuotaExceeded(true, "Table was created and data was written")});
2922+
2923+
TestDropTable(runtime, ++txId, "/MyRoot/USER_0", "Table1");
2924+
waitForSchemaChanged(1);
2925+
env.TestWaitNotification(runtime, txId);
2926+
2927+
TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"), {LsCheckDiskQuotaExceeded(false, "Table dropped")});
2928+
};
2929+
29102930
// Subdomain with a 1-byte data size quota
29112931
TestCreateSubDomain(runtime, ++txId, "/MyRoot", R"(
29122932
Name: "USER_0"
@@ -2931,29 +2951,30 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
29312951
TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"),
29322952
{LsCheckDiskQuotaExceeded(false, "SubDomain created")});
29332953

2934-
// skip a single coordinator and mediator
2935-
ui64 tabletId = TTestTxConfig::FakeHiveTablets + 2;
2954+
// UpdateRow
2955+
{
2956+
createTable();
29362957

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

2945-
UpdateRow(runtime, "Table1", 1, "value1", tabletId);
2946-
waitForTableStats(1);
2962+
checkQuotaAndDropTable();
2963+
}
29472964

2948-
TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"),
2949-
{LsCheckDiskQuotaExceeded(true, "Table was created and data was written")});
2965+
// WriteRow
2966+
{
2967+
createTable();
29502968

2951-
TestDropTable(runtime, ++txId, "/MyRoot/USER_0", "Table1");
2952-
waitForSchemaChanged(1);
2953-
env.TestWaitNotification(runtime, txId);
2969+
bool successIsExpected = true;
2970+
WriteRow(runtime, ++txId, "/MyRoot/USER_0/Table1", 0, 1, "value1", successIsExpected);
2971+
waitForTableStats(1);
29542972

2955-
TestDescribeResult(DescribePath(runtime, "/MyRoot/USER_0"),
2956-
{LsCheckDiskQuotaExceeded(false, "Table dropped")});
2973+
successIsExpected = false;
2974+
WriteRow(runtime, ++txId, "/MyRoot/USER_0/Table1", 0, 1, "value1", successIsExpected);
2975+
2976+
checkQuotaAndDropTable();
2977+
}
29572978
}
29582979

29592980
Y_UNIT_TEST(SchemeDatabaseQuotaRejects) {

0 commit comments

Comments
 (0)