Skip to content

Commit

Permalink
Do not use autopartition settings when autopartitioning was disabled … (
Browse files Browse the repository at this point in the history
  • Loading branch information
nshestakov authored Sep 13, 2024
1 parent 65caa64 commit 6302bdc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ydb/services/lib/actors/pq_schema_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,12 @@ namespace NKikimr::NGRpcProxy::V1 {
}

std::optional<TYdbPqCodes> 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();
Expand All @@ -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);
}
Expand Down

0 comments on commit 6302bdc

Please sign in to comment.