mattisonchao opened a new pull request, #15653:
URL: https://github.com/apache/pulsar/pull/15653
### Motivation
When the user wants to set the `AutoTopicCreationOverride` policy with
`non-partitioned` type, the correct request body is as below.
```json
{
"allowAutoTopicCreation": true,
"topicType": "non-partitioned"
}
```
On the broker side, the request body entity field `defaultNumPartitions` is
`null`. the NPE will occur when the user sets config
`maxNumPartitionsPerPartitionedTopic` greater than 0.
https://github.com/apache/pulsar/blob/3c60063716d3cdd561bf1e956a551a2297869fd9/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java#L839-L842
### Modifications
- Check `maxNumPartitionsPerPartitionedTopic` just `topicType` is
`partitioned`
### Verifying this change
- [x] Make sure that the change passes the CI checks.
Add a test `testAutoTopicCreationOverrideWithMaxNumPartitionsLimit` to
verify this change.
### Documentation
- [x] `no-need-doc`
--
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]