lhotari commented on code in PR #25163:
URL: https://github.com/apache/pulsar/pull/25163#discussion_r2703783155


##########
pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/impl/AutoTopicCreationOverrideImpl.java:
##########
@@ -51,11 +51,6 @@ public static ValidateResult 
validateOverride(AutoTopicCreationOverride override
                 if (override.getDefaultNumPartitions() <= 0) {
                     return ValidateResult.fail("[defaultNumPartitions] cannot 
be less than 1 for partition type.");
                 }
-            } else if 
(TopicType.NON_PARTITIONED.toString().equals(override.getTopicType())) {
-                if (override.getDefaultNumPartitions() != null) {
-                    return ValidateResult.fail("[defaultNumPartitions] is not 
allowed to be"

Review Comment:
   Instead of removing this completely, I'd suggesting checking that 
`override.getDefaultNumPartitions()` is null, `0` or `1`, so that it would be 
allowed only in that case. The more consistent solution would be to only allow 
`0` since that's what value is used internally when the topic is a 
non-partitioned topic. However, if we make this change, it seems to make sense 
to allow also `1`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to