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

fix the bug, can not update topic when the update topicName is contained by an existed topic as a part #11686

Merged
merged 2 commits into from
Aug 25, 2021

Conversation

Nicklee007
Copy link
Contributor

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.

@Anonymitaet
Copy link
Member

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)

@Nicklee007
Copy link
Contributor Author

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.

Copy link
Contributor

@gaozhangmin gaozhangmin left a 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

@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Aug 19, 2021
Copy link
Contributor

@codelipenghui codelipenghui left a 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?

@Nicklee007
Copy link
Contributor Author

The change looks good to me, @Nicklee007 Could you please add some tests for the new change?

@codelipenghui thanks, I have added the test for update the partitioned topic which a part topicName is contained in another old topicName.

@hangc0276
Copy link
Contributor

@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.

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @Nicklee007

@hangc0276 hangc0276 merged commit 241de4b into apache:master Aug 25, 2021
hangc0276 pushed a commit that referenced this pull request Aug 25, 2021
…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)
@hangc0276 hangc0276 added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Aug 25, 2021
codelipenghui pushed a commit that referenced this pull request Dec 11, 2021
…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)
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Dec 11, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.7 Archived: 2.7 is end of life cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.7.4 release/2.8.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can not update topic when the update topicName is contained by an existed topic as a part
6 participants