aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorazevaykin <145343289+azevaykin@users.noreply.github.com>2023-12-22 16:03:33 +0300
committerGitHub <noreply@github.com>2023-12-22 16:03:33 +0300
commit653229b09d884289a3837561d7da3351a3bb6e8f (patch)
treeded02abfa23169099d06b99ea548dc3bda4cdb1c
parentdc0ac0a80bcd1ab879b04dd18e2eeb7fbb45e4b5 (diff)
downloadydb-653229b09d884289a3837561d7da3351a3bb6e8f.tar.gz
WriteRow out of space (#665)
-rw-r--r--ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp57
1 files changed, 39 insertions, 18 deletions
diff --git a/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp b/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp
index bbda860bc1..2bb6fae3d3 100644
--- a/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp
+++ b/ydb/core/tx/schemeshard/ut_subdomain/ut_subdomain.cpp
@@ -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"
@@ -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) {