Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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