Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent creation of regular topic with the same name as existing part…
…itioned topic (apache#5943) ### Motivation Currently, it is not possible to create a partitioned topic with the same name as an existing non-partitioned topic, but the reverse is possible. ``` $ ./bin/pulsar-admin topics create persistent://public/default/t1 $ ./bin/pulsar-admin topics create-partitioned-topic -p 2 persistent://public/default/t1 16:12:50.418 [AsyncHttpClient-5-1] WARN org.apache.pulsar.client.admin.internal.BaseResource - [http://localhost:8080/admin/v2/persistent/public/default/t1/partitions] Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 409 Conflict This topic already exists Reason: This topic already exists $ ./bin/pulsar-admin topics create-partitioned-topic -p 2 persistent://public/default/t2 $ ./bin/pulsar-admin topics create persistent://public/default/t2 $ ./bin/pulsar-admin topics list public/default "persistent://public/default/t2" "persistent://public/default/t1" $ ./bin/pulsar-admin topics list-partitioned-topics public/default "persistent://public/default/t2" ``` These non-partitioned topics are not available and should not be created. ### Modifications When creating a non-partitioned topic, "409 Conflict" error will be returned if a partitioned topic with the same name already exists.
- Loading branch information