Skip to content
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

[pulsar-broker] Prevent creation of regular topic with the same name as existing partitioned topic #5943

Merged
merged 1 commit into from Jan 6, 2020

Conversation

@massakam
Copy link
Contributor

massakam commented Dec 26, 2019

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.

@massakam massakam self-assigned this Dec 26, 2019
@massakam

This comment has been minimized.

Copy link
Contributor Author

massakam commented Dec 27, 2019

retest this please

@jiazhai

This comment has been minimized.

Copy link
Member

jiazhai commented Dec 29, 2019

retest this please

2 similar comments
@codelipenghui

This comment has been minimized.

Copy link
Contributor

codelipenghui commented Dec 30, 2019

retest this please

@tuteng

This comment has been minimized.

Copy link
Member

tuteng commented Dec 31, 2019

retest this please

@sijie
sijie approved these changes Jan 1, 2020
@sijie

This comment has been minimized.

Copy link
Member

sijie commented Jan 1, 2020

run java8 tests

@sijie sijie merged commit 7fd3f70 into apache:master Jan 6, 2020
10 of 18 checks passed
10 of 18 checks passed
cpp-tests cpp-tests
Details
backwards-compatibility backwards-compatibility
Details
process process
Details
sql sql
Details
thread thread
Details
License check License check
Details
unit-test-flaky unit-test-flaky
Details
unit-tests unit-tests
Details
cli
Details
function-state
Details
messaging
Details
schema
Details
standalone
Details
tiered-filesystem
Details
tiered-jcloud
Details
Jenkins: C++ / Python Tests SUCCESS
Details
Jenkins: Integration Tests SUCCESS
Details
Jenkins: Java 8 - Unit Tests SUCCESS
Details
@massakam massakam deleted the massakam:fix-topic-creation-api branch Jan 6, 2020
@sijie sijie added the release/2.5.1 label Jan 22, 2020
@sijie sijie added this to the 2.6.0 milestone Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.