aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexnick <alexnick@ydb.tech>2022-09-09 16:52:44 +0300
committeralexnick <alexnick@ydb.tech>2022-09-09 16:52:44 +0300
commitfcecce903b52489c4744186556dfb1ef0ff4d28d (patch)
tree51111026b77c325ef42cbd78f8af49848776900f
parent8e4ae907ec6bf61b8a0dc0ad0ed61fc512559ea2 (diff)
downloadydb-fcecce903b52489c4744186556dfb1ef0ff4d28d.tar.gz
choose correct retention/storage together
-rw-r--r--ydb/services/datastreams/datastreams_proxy.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/ydb/services/datastreams/datastreams_proxy.cpp b/ydb/services/datastreams/datastreams_proxy.cpp
index f4948a465f..95e1edadd0 100644
--- a/ydb/services/datastreams/datastreams_proxy.cpp
+++ b/ydb/services/datastreams/datastreams_proxy.cpp
@@ -153,7 +153,7 @@ namespace NKikimr::NDataStreams::V1 {
if (GetProtoRequest()->retention_case() ==
Ydb::DataStreams::V1::CreateStreamRequest::RetentionCase::kRetentionStorageMegabytes) {
modifyScheme.MutableCreatePersQueueGroup()->MutablePQTabletConfig()->
- MutablePartitionConfig()->SetLifetimeSeconds(TDuration::Days(7).Seconds());
+ MutablePartitionConfig()->SetLifetimeSeconds(TDuration::Hours(DEFAULT_STREAM_WEEK_RETENTION).Seconds());
}
modifyScheme.SetWorkingDir(workingDir);
@@ -387,8 +387,12 @@ namespace NKikimr::NDataStreams::V1 {
case Ydb::DataStreams::V1::UpdateStreamRequest::RetentionCase::kRetentionPeriodHours:
groupConfig.MutablePQTabletConfig()->MutablePartitionConfig()->SetLifetimeSeconds(
TDuration::Hours(GetProtoRequest()->retention_period_hours()).Seconds());
+ groupConfig.MutablePQTabletConfig()->MutablePartitionConfig()->ClearStorageLimitBytes();
+
break;
case Ydb::DataStreams::V1::UpdateStreamRequest::RetentionCase::kRetentionStorageMegabytes:
+ groupConfig.MutablePQTabletConfig()->MutablePartitionConfig()->SetLifetimeSeconds(
+ TDuration::Hours(DEFAULT_STREAM_WEEK_RETENTION).Seconds());
groupConfig.MutablePQTabletConfig()->MutablePartitionConfig()->SetStorageLimitBytes(
GetProtoRequest()->retention_storage_megabytes() * 1_MB);
break;