[fix][admin] Allow defaultNumPartitions for non-partitioned autoTopicCreation override - #25163
Conversation
…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.
LGTM, thanks for the contribution @ChimdumebiNebolisa
…efaultNumPartitions
Co-authored-by: Cursor <cursoragent@cursor.com>
lhotari
left a comment
There was a problem hiding this comment.
The updated tests now match the intended narrow validation: non-partitioned overrides accept null, 0, or 1, while the REST-level test verifies that 5 is rejected with HTTP 412. The accepted value is also verified as persisted but ignored at topic creation, producing a non-partitioned topic. I found no remaining issue in the current 125-line PR diff. The tracker delta contains unrelated upstream merges since the previous approval, so those were excluded in favor of the canonical three-file PR diff.
|
Fixed the Broker Group 3 CI failure in 1bdd1b6 by updating the stale validation-message assertion. The exact failing test now passes locally, and git diff --check is clean. The new CI runs are awaiting maintainer approval. |
Fixes #24998
Motivation
The namespace
autoTopicCreationoverride validation rejectsdefaultNumPartitionswhenevertopicType=non-partitioned. This forces clients and infrastructure-as-code tools to conditionally omit the field, making shared configuration templates harder to maintain.The relaxation is intentionally narrow. For non-partitioned overrides,
defaultNumPartitionsmay benull,0, or1. Values greater than1remain invalid.Accepted values are persisted as submitted but ignored during runtime topic creation. Auto-created topics therefore remain non-partitioned.
Modifications
AutoTopicCreationOverrideImpl.validateOverrideto allowdefaultNumPartitionsforNON_PARTITIONEDonly when the value isnull,0, or1.0and1are accepted and2is rejected.1is persisted but ignored when the topic is auto-created5is rejected by the admin REST API with HTTP 412Verifying this change
Does this pull request potentially affect one of the following parts:
Documentation
doc-not-needed