rdhabalia commented on code in PR #10601:
URL: https://github.com/apache/pulsar/pull/10601#discussion_r1024344326


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -543,6 +543,21 @@ protected PartitionedTopicMetadata 
internalGetPartitionedMetadata(boolean author
                                                                       boolean 
checkAllowAutoCreation) {
         PartitionedTopicMetadata metadata = 
getPartitionedTopicMetadata(topicName,
                 authoritative, checkAllowAutoCreation);
+        if (metadata.partitions == 0 && !checkAllowAutoCreation) {
+            // The topic may be a non-partitioned topic, so check if it exists 
here.
+            // However, when checkAllowAutoCreation is true, the client will 
create the topic if it doesn't exist.
+            // In this case, `partitions == 0` means the automatically created 
topic is a non-partitioned topic so we
+            // shouldn't check if the topic exists.
+            try {
+                if 
(!pulsar().getNamespaceService().checkTopicExists(topicName).get()) {
+                    throw new RestException(Status.NOT_FOUND,

Review Comment:
   this breaks HTTP lookup for all the previous clients and also breaks the 
semantic of topic creation. why are we creating new semantics by breaking the 
compatibility? what are we trying to achieve here?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to