From 550a76bf22761f7ea79999536e2aa1d535de592d Mon Sep 17 00:00:00 2001 From: Nikolay Shestakov Date: Fri, 13 Sep 2024 08:47:23 +0500 Subject: [PATCH] Do not use autopartition settings when autopartitioning was disabled (#9005) --- ydb/services/lib/actors/pq_schema_actor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ydb/services/lib/actors/pq_schema_actor.cpp b/ydb/services/lib/actors/pq_schema_actor.cpp index 9eadb2ab7e8a..49331ea0a7cf 100644 --- a/ydb/services/lib/actors/pq_schema_actor.cpp +++ b/ydb/services/lib/actors/pq_schema_actor.cpp @@ -685,8 +685,12 @@ namespace NKikimr::NGRpcProxy::V1 { } std::optional ValidatePartitionStrategy(const ::NKikimrPQ::TPQTabletConfig& config, TString& error) { - if (!config.has_partitionstrategy()) + if (!config.HasPartitionStrategy()) { return std::nullopt; + } + if (::NKikimrPQ::TPQTabletConfig_TPartitionStrategyType::TPQTabletConfig_TPartitionStrategyType_DISABLED == config.GetPartitionStrategy().GetPartitionStrategyType()) { + return std::nullopt; + } auto strategy = config.GetPartitionStrategy(); if (strategy.GetMinPartitionCount() < 0) { error = TStringBuilder() << "Partitions count must be non-negative, provided " << strategy.GetMinPartitionCount(); @@ -713,7 +717,7 @@ namespace NKikimr::NGRpcProxy::V1 { error = TStringBuilder() << "Partition scale threshold time must be greater then 1 second, provided " << strategy.GetScaleThresholdSeconds() << " seconds"; return TYdbPqCodes(Ydb::StatusIds::BAD_REQUEST, Ydb::PersQueue::ErrorCode::VALIDATION_ERROR); } - if (strategy.GetPartitionStrategyType() != ::NKikimrPQ::TPQTabletConfig_TPartitionStrategyType::TPQTabletConfig_TPartitionStrategyType_DISABLED && config.GetPartitionConfig().HasStorageLimitBytes()) { + if (config.GetPartitionConfig().HasStorageLimitBytes()) { error = TStringBuilder() << "Auto partitioning is incompatible with retention storage bytes option"; return TYdbPqCodes(Ydb::StatusIds::BAD_REQUEST, Ydb::PersQueue::ErrorCode::VALIDATION_ERROR); }