-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Reject auto create partitioned topic when topic name contains -partition-
#14920
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
[fix][broker] Reject auto create partitioned topic when topic name contains -partition-
#14920
Conversation
…ins ``-partition-``
-partition--partition-
...ar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentTopicTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
|
@Technoboy- @AnonHxy PTAL :) |
|
LGTM |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Show resolved
Hide resolved
...ar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentTopicTest.java
Show resolved
Hide resolved
Jason918
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.
I think it's better to narrow the limitation to ends with -partition-\d+
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Outdated
Show resolved
Hide resolved
@mattisonchao What do you think about this? |
@Jason918 |
|
Hi, @Jason918 |
Jason918
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
|
/pulsarbot rerun-failure-checks |
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
Show resolved
Hide resolved
|
/pulsarbot rerun-failure-checks |
…ntains ``-partition-`` (apache#14920)
…ntains ``-partition-`` (apache#14920)
|
@mattisonchao It might introduce a breaking change for DLQ, please help check the topic auto-creation with partitioned topic can work with DLQ with this change. |
|
Yes, We have to revert this PR and start a discussion in the mail list to find another graceful method. |
Motivation
When the user set config as follow:
{ allowAutoTopicCreation: true, allowAutoTopicCreationType: "partitioned", defaultNumPartitions: 1 }they can create partitioned topic success with topic name
persistent://prop/autoNs/failedcreate-partition-abcde.run get-partitioned-topic-metadata
{ "partitions" : 1 }run
admin.topics().deletePartitionedTopic(topicName);run
admin.topics().delete(topicName)this operation can success delete the topic, but metadata still exists.
Modifications
Describe the modifications you've done.
Verifying this change
Add TCP/HTTP client test for this change.
Documentation
no-need-doc