From 29605a2a505fc1c0dd855f369e736c6d22e34e14 Mon Sep 17 00:00:00 2001 From: Nikita Saveliev Date: Wed, 25 Sep 2024 07:49:20 +0000 Subject: [PATCH] fix --- .../datastreams/datastreams_proxy.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ydb/services/datastreams/datastreams_proxy.cpp b/ydb/services/datastreams/datastreams_proxy.cpp index 48277a3c5ff0..e7f8ac11a45d 100644 --- a/ydb/services/datastreams/datastreams_proxy.cpp +++ b/ydb/services/datastreams/datastreams_proxy.cpp @@ -471,14 +471,7 @@ namespace NKikimr::NDataStreams::V1 { Y_UNUSED(selfInfo); TString error; - if (!GetProtoRequest()->has_partitioning_settings()) { - if (!ValidateShardsCount(*GetProtoRequest(), pqGroupDescription, error)) - { - return ReplyWithError(Ydb::StatusIds::BAD_REQUEST, static_cast(NYds::EErrorCodes::BAD_REQUEST), error); - } - groupConfig.SetTotalGroupCount(GetProtoRequest()->target_shard_count()); - } switch (GetProtoRequest()->retention_case()) { case Ydb::DataStreams::V1::UpdateStreamRequest::RetentionCase::kRetentionPeriodHours: groupConfig.MutablePQTabletConfig()->MutablePartitionConfig()->SetLifetimeSeconds( @@ -520,7 +513,17 @@ namespace NKikimr::NDataStreams::V1 { } } - if (GetProtoRequest()->has_partitioning_settings()) { + if (!GetProtoRequest()->has_partitioning_settings() || + (GetProtoRequest()->partitioning_settings().has_auto_partitioning_settings() && + GetProtoRequest()->partitioning_settings().auto_partitioning_settings().strategy() == + Ydb::DataStreams::V1::AutoPartitioningStrategy::AUTO_PARTITIONING_STRATEGY_DISABLED)) { + if (!ValidateShardsCount(*GetProtoRequest(), pqGroupDescription, error)) + { + return ReplyWithError(Ydb::StatusIds::BAD_REQUEST, static_cast(NYds::EErrorCodes::BAD_REQUEST), error); + } + + groupConfig.SetTotalGroupCount(GetProtoRequest()->target_shard_count()); + } else { auto r = ValidatePartitioningSettings(GetProtoRequest()->partitioning_settings()); if (!r.empty()) { return ReplyWithError(Ydb::StatusIds::BAD_REQUEST, static_cast(NYds::EErrorCodes::INVALID_ARGUMENT), r);