aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexnick <alexnick@ydb.tech>2022-08-17 11:57:30 +0300
committeralexnick <alexnick@ydb.tech>2022-08-17 11:57:30 +0300
commitbaa55afabf45e8fcfefe7fc4b1430901df5e382d (patch)
tree33f642071358d39b24a8e2be9f51d1d7fd65291b
parent4ab87f84ab452e7a704795697d0746cc756ceec5 (diff)
downloadydb-baa55afabf45e8fcfefe7fc4b1430901df5e382d.tar.gz
fix for reserved storage
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp8
-rw-r--r--ydb/services/datastreams/datastreams_ut.cpp7
2 files changed, 14 insertions, 1 deletions
diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp
index 6a9fd0e230..8b1382b5b2 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_drop_pq.cpp
@@ -214,7 +214,13 @@ public:
Y_VERIFY(parseOk);
ui64 throughput = ((ui64)pqGroup->TotalPartitionCount) * config.GetPartitionConfig().GetWriteSpeedInBytesPerSecond();
- ui64 storage = throughput * config.GetPartitionConfig().GetLifetimeSeconds();
+ const ui64 storage = [&config, &throughput]() {
+ if (config.GetPartitionConfig().HasStorageLimitBytes()) {
+ return config.GetPartitionConfig().GetStorageLimitBytes();
+ } else {
+ return throughput * config.GetPartitionConfig().GetLifetimeSeconds();
+ }
+ }();
auto domainInfo = context.SS->ResolveDomainInfo(pathId);
domainInfo->DecPathsInside();
diff --git a/ydb/services/datastreams/datastreams_ut.cpp b/ydb/services/datastreams/datastreams_ut.cpp
index 2c1dbeeee9..fa9c1b0cf5 100644
--- a/ydb/services/datastreams/datastreams_ut.cpp
+++ b/ydb/services/datastreams/datastreams_ut.cpp
@@ -477,6 +477,13 @@ Y_UNIT_TEST_SUITE(DataStreams) {
"put_events");
});
UNIT_ASSERT_VALUES_EQUAL(putUnitsSchemaFound, 20);
+
+ NYdb::NPersQueue::TPersQueueClient pqClient(*testServer.Driver);
+ {
+ auto res = pqClient.DropTopic(streamName);
+ res.Wait();
+ UNIT_ASSERT(res.GetValue().IsSuccess());
+ }
}
Y_UNIT_TEST(TestNonChargeableUser) {