-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 the bug, can not update topic when the update topicName is contained by an existed topic as a part #11686
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Show resolved
Hide resolved
Thanks for your contribution. For this PR, do we need to update docs? (The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks) |
It's fix a bug and don't change any system function, I think not need to update docs. |
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.
miss space between topic and exsitingTopicName
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.
The change looks good to me, @Nicklee007 Could you please add some tests for the new change?
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Show resolved
Hide resolved
@codelipenghui thanks, I have added the test for update the partitioned topic which a part topicName is contained in another old topicName. |
@lhotari Would you please review this PR again? I am cutting 2.8.1, i'd like to include this pr in 2.8.1, thanks. |
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.
Good work @Nicklee007
…ned by an existed topic as a part (#11686) Fixes #11685 validatePartitionTopicUpdate use contain to check if there has a exist topic will cause conflict, which will cause a failed when exist a topic which contain the new topic's prefix and we want to update the new topic partition; we have a those topic "persistent://public/default/113p-partition-0" "persistent://public/default/113p-partition-1" "persistent://public/default/113p-partition-2" "persistent://public/default/3p-partition-0" when we want to update topic 3p to more partitions ,we failed because "persistent://public/default/113p-partition-0" contain "3p-partition" Modifications use the startwith to check if exist the same topic. * fix the bug, the old topic contain a same strSub cause couldn't add new partitions * add update the partitioned topic which a part is coontained in old topic test Co-authored-by: nicklixinyang <nicklixinyang@didiglobal.com> (cherry picked from commit 241de4b)
…ned by an existed topic as a part (#11686) Fixes #11685 validatePartitionTopicUpdate use contain to check if there has a exist topic will cause conflict, which will cause a failed when exist a topic which contain the new topic's prefix and we want to update the new topic partition; we have a those topic "persistent://public/default/113p-partition-0" "persistent://public/default/113p-partition-1" "persistent://public/default/113p-partition-2" "persistent://public/default/3p-partition-0" when we want to update topic 3p to more partitions ,we failed because "persistent://public/default/113p-partition-0" contain "3p-partition" Modifications use the startwith to check if exist the same topic. * fix the bug, the old topic contain a same strSub cause couldn't add new partitions * add update the partitioned topic which a part is coontained in old topic test Co-authored-by: nicklixinyang <nicklixinyang@didiglobal.com> (cherry picked from commit 241de4b)
…ned by an existed topic as a part (apache#11686) Fixes apache#11685 validatePartitionTopicUpdate use contain to check if there has a exist topic will cause conflict, which will cause a failed when exist a topic which contain the new topic's prefix and we want to update the new topic partition; we have a those topic "persistent://public/default/113p-partition-0" "persistent://public/default/113p-partition-1" "persistent://public/default/113p-partition-2" "persistent://public/default/3p-partition-0" when we want to update topic 3p to more partitions ,we failed because "persistent://public/default/113p-partition-0" contain "3p-partition" Modifications use the startwith to check if exist the same topic. * fix the bug, the old topic contain a same strSub cause couldn't add new partitions * add update the partitioned topic which a part is coontained in old topic test Co-authored-by: nicklixinyang <nicklixinyang@didiglobal.com>
Fixes #11685
validatePartitionTopicUpdate use contain to check if there has a exist topic will cause conflict, which will cause a failed when exist a topic which contain the new topic's prefix and we want to update the new topic partition;
we have a those topic
"persistent://public/default/113p-partition-0"
"persistent://public/default/113p-partition-1"
"persistent://public/default/113p-partition-2"
"persistent://public/default/3p-partition-0"
when we want to update topic 3p to more partitions ,we failed because "persistent://public/default/113p-partition-0" contain "3p-partition"
Modifications
use the startwith to check if exist the same topic.