-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][admin] Allow defaultNumPartitions for non-partitioned autoTopicCreation override #25163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[fix][admin] Allow defaultNumPartitions for non-partitioned autoTopicCreation override #25163
Conversation
...src/main/java/org/apache/pulsar/common/policies/data/impl/AutoTopicCreationOverrideImpl.java
Show resolved
Hide resolved
…cCreation override
…tioned autoTopicCreation override
6a10c6a to
7a13f42
Compare
|
Updated |
Please add this information to the PR description. |
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the contribution @ChimdumebiNebolisa
Fixes #24998
Motivation
The current namespace
autoTopicCreationoverride validation rejectsdefaultNumPartitionswhentopicType=non-partitioned. This forces clients and IaC tooling to conditionally omit a field based on topic type, which makes the API less consistent and more error-prone.Modifications
AutoTopicCreationOverridevalidation to allowdefaultNumPartitionsto be set whentopicType=non-partitioned(value is accepted and persisted).defaultNumPartitionsis still only used for partitioned auto-creation.Verifying this change
This change added tests and can be verified as follows:
mvn -pl pulsar-common -Dtest=AutoTopicCreationOverrideTest testmvn -pl pulsar-broker -am -Dtest=AdminApi2Test#testAutoTopicCreationOverrideNonPartitionedDefaultNumPartitionsIgnored -Dsurefire.failIfNoSpecifiedTests=false testDoes this pull request potentially affect one of the following parts:
Documentation
doc-not-neededNote: Updated
validateOverrideto preserve topic type validation and allowdefaultNumPartitionsfor NON_PARTITIONED topics only when the value isnull,0, or1. Updated unit tests to cover0,1, and to reject2.