Skip to content

Commit 87489e4

Browse files
committed
fix
1 parent 9964b44 commit 87489e4

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

ydb/core/persqueue/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ui64 TopicPartitionReserveThroughput(const NKikimrPQ::TPQTabletConfig& config) {
3333
}
3434

3535
bool SplitMergeEnabled(const NKikimrPQ::TPQTabletConfig& config) {
36-
return 0 < config.GetPartitionStrategy().GetMaxPartitionCount();
36+
return config.has_partitionstrategy() && config.partitionstrategy().has_partitionstrategytype() && config.partitionstrategy().partitionstrategytype() != ::NKikimrPQ::TPQTabletConfig_TPartitionStrategyType::TPQTabletConfig_TPartitionStrategyType_DISABLED;
3737
}
3838

3939
static constexpr ui64 PUT_UNIT_SIZE = 40960u; // 40Kb

ydb/public/lib/ydb_cli/commands/ydb_service_topic.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,14 @@ namespace {
305305
NYdb::NTopic::TTopicClient topicClient(driver);
306306

307307
auto settings = NYdb::NTopic::TCreateTopicSettings();
308-
Y_ABORT_UNLESS(GetAutoscalingStrategy() || GetScaleThresholdTime() || GetScaleUpThresholdPercent() || GetScaleDownThresholdPercent(), "Autoscaling parameters for TCommandTopicCreate can not be empty");
309-
auto autoscaleSettings = NTopic::TAutoscalingSettings(*GetAutoscalingStrategy(), TDuration::Seconds(*GetScaleThresholdTime()), *GetScaleUpThresholdPercent(), *GetScaleDownThresholdPercent());
308+
309+
auto autoscaleSettings = NTopic::TAutoscalingSettings(
310+
GetAutoscalingStrategy() ? *GetAutoscalingStrategy() : NTopic::EAutoscalingStrategy::Disabled,
311+
GetScaleThresholdTime() ? TDuration::Seconds(*GetScaleThresholdTime()) : TDuration::Seconds(0),
312+
GetScaleUpThresholdPercent() ? *GetScaleUpThresholdPercent() : 0,
313+
GetScaleDownThresholdPercent() ? *GetScaleDownThresholdPercent() : 0);
314+
315+
settings.PartitioningSettings(MinActivePartitions_, MaxActivePartitions_, autoscaleSettings);
310316
settings.PartitionWriteBurstBytes(PartitionWriteSpeedKbps_ * 1_KB);
311317
settings.PartitionWriteSpeedBytesPerSecond(PartitionWriteSpeedKbps_ * 1_KB);
312318

ydb/public/sdk/cpp/client/ydb_topic/include/control_plane.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ struct TCreateTopicSettings : public TOperationRequestSettings<TCreateTopicSetti
558558
return *this;
559559
}
560560

561-
TCreateTopicSettings& PartitioningSettings(ui64 minActivePartitions, ui64 /*partitionCountLimit*/, ui64 maxActivePartitions = 0, TAutoscalingSettings autoscalingSettings = {}) {
561+
TCreateTopicSettings& PartitioningSettings(ui64 minActivePartitions, ui64 maxActivePartitions, TAutoscalingSettings autoscalingSettings = {}) {
562562
PartitioningSettings_ = TPartitioningSettings(minActivePartitions, maxActivePartitions, autoscalingSettings);
563563
return *this;
564564
}

0 commit comments

Comments
 (0)