You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/18 02:04:55 UTC

[GitHub] [pulsar] gaozhangmin commented on a change in pull request #11686: fix the bug, can not update topic when the update topicName is contained by an existed topic as a part

gaozhangmin commented on a change in pull request #11686:
URL: https://github.com/apache/pulsar/pull/11686#discussion_r690845106



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -3773,9 +3773,9 @@ private void validatePartitionTopicUpdate(String topicName, int numberOfPartitio
         TopicName partitionTopicName = TopicName.get(domain(), namespaceName, topicName);
         PartitionedTopicMetadata metadata = getPartitionedTopicMetadata(partitionTopicName, false, false);
         int oldPartition = metadata.partitions;
-        String prefix = topicName + TopicName.PARTITIONED_TOPIC_SUFFIX;
+        String prefix = partitionTopicName.getPartitionedTopicName() + TopicName.PARTITIONED_TOPIC_SUFFIX;
         for (String exsitingTopicName : existingTopicList) {
-            if (exsitingTopicName.contains(prefix)) {
+            if (exsitingTopicName.startsWith(prefix)) {

Review comment:
       > There is a PR #11148 in progress in this same area. I'd suggest contributing to #11148 to fix this issue #11685. One form of contributing is making sure that this problem gets fixed with the refactored implementation for checking topic existence.
   
   it's full name `String prefix = partitionTopicName.getPartitionedTopicName() + TopicName.PARTITIONED_TOPIC_SUFFIX`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org