-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codelipenghui
approved these changes
Dec 26, 2019
retest this please |
jiazhai
approved these changes
Dec 29, 2019
retest this please |
2 similar comments
retest this please |
retest this please |
sijie
approved these changes
Jan 1, 2020
run java8 tests |
tuteng
pushed a commit
to AmateurEvents/pulsar
that referenced
this pull request
Feb 23, 2020
…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.
tuteng
pushed a commit
to AmateurEvents/pulsar
that referenced
this pull request
Mar 21, 2020
…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. (cherry picked from commit 7fd3f70)
tuteng
pushed a commit
that referenced
this pull request
Apr 13, 2020
…itioned topic (#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. (cherry picked from commit 7fd3f70)
jiazhai
pushed a commit
to jiazhai/pulsar
that referenced
this pull request
May 18, 2020
…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. (cherry picked from commit 7fd3f70)
huangdx0726
pushed a commit
to huangdx0726/pulsar
that referenced
this pull request
Aug 24, 2020
…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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.