merlimat commented on a change in pull request #3111: Improve  user prompts on 
get topic reference
URL: https://github.com/apache/pulsar/pull/3111#discussion_r238386071
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
 ##########
 @@ -1231,7 +1231,16 @@ protected OffloadProcessStatus 
internalOffloadStatus(boolean authoritative) {
      */
     private Topic getTopicReference(TopicName topicName) {
         return 
pulsar().getBrokerService().getTopicIfExists(topicName.toString()).join()
-                .orElseThrow(() -> new RestException(Status.NOT_FOUND, "Topic 
not found"));
+                .orElseThrow(() -> {
+                    if 
(topicName.getCompleteTopicName().contains(TopicName.PARTITIONED_TOPIC_SUFFIX)) 
{
+                        if 
(!internalGetPartitionedTopicList().contains(topicName.getPartitionedTopicName()))
 {
 
 Review comment:
   I think `internalGetPartitionedTopicList()` is not appropriate here because 
it will try to get the list of partitioned topics for a specific namespace. 
Rather, we should just do a point check for this specific `topicName` and check 
the partitioned topic metadata for the validation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to