codelipenghui commented on a change in pull request #9786:
URL: https://github.com/apache/pulsar/pull/9786#discussion_r587932118



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -797,9 +798,21 @@ public void unloadNamespaceBundlesGracefully() {
                     return this.loadOrCreatePersistentTopic(topicName, 
createIfMissing);
                 });
             } else {
-                return topics.computeIfAbsent(topic, (topicName) -> {
-                    if (createIfMissing) {
-                        return createNonPersistentTopic(topicName);
+                return topics.computeIfAbsent(topic, (name) -> {
+                    final TopicName topicName = TopicName.get(name);
+                    if (topicName.isPartitioned()) {
+                        try {
+                            final PartitionedTopicMetadata metadata = 
pulsar().getAdminClient().topics()
+                                    
.getPartitionedTopicMetadata(topicName.getPartitionedTopicName());

Review comment:
       You can use `fetchPartitionedTopicMetadataAsync` in the 
BrokerService.java, this one will fetch the metadata from the zookeeper cache.




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

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


Reply via email to