apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.26k stars 3.59k forks source link

[improve][broker]Restrict the creation of topics with "-partition--x" #23562

Open zjxxzjwang opened 2 weeks ago

zjxxzjwang commented 2 weeks ago

Motivation

If you actively create a topic with "-partition--x" (x is an integer)(for example, "peisisten://tenant-name/ns-name/topic-name-partition--1"), the topic can be created successfully, and a node with partition 3 will be attached to the zk. But it is not a partition topic

Modifications

By modifying the isAllowAutoTopicCreationAsync logic () method, when the topic name contains "- partiton - x" (x is an integer), trigger logic returns false

image

Documentation

Matching PR in forked repository

PR in forked repository:

github-actions[bot] commented 2 weeks ago

@zjxxzjwang Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
lhotari commented 1 week ago

Please add a test case for the new functionality

zjxxzjwang commented 1 week ago

请为新功能添加测试示例

OK, I've added a test case.