Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
niksaveliev committed Sep 25, 2024
1 parent ddf8d01 commit 29605a2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions ydb/services/datastreams/datastreams_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>(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(
Expand Down Expand Up @@ -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<size_t>(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<size_t>(NYds::EErrorCodes::INVALID_ARGUMENT), r);
Expand Down

0 comments on commit 29605a2

Please sign in to comment.