Pomelongan commented on code in PR #17946:
URL: https://github.com/apache/pulsar/pull/17946#discussion_r990596584


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -4552,6 +4555,75 @@ private CompletableFuture<Void> 
createSubscriptions(TopicName topicName, int num
         return result;
     }
 
+    /**
+     * It creates subscriptions for new partitions of existing 
partitioned-topics.
+     *
+     * @param topicName     : topic-name: persistent://prop/cluster/ns/topic
+     * @param numPartitions : number partitions for the topics
+     *
+     */
+    private CompletableFuture<Void> createMissedSubscriptionsAsync(TopicName 
topicName, int numPartitions) {
+        CompletableFuture<Void> result = new CompletableFuture<>();
+        PulsarAdmin admin;
+        try {
+            admin = pulsar().getAdminClient();

Review Comment:
   
`org.apache.pulsar.broker.admin.impl.PersistentTopicsBase#internalCreateMissedPartitions`
 does not call `validateTopicOwnershipAsync` to verify whether the topic 
belongs to the broker, but only to determine whether the topic belongs to the 
namespace of the broker, so I have reserved the logic of using admin to create 
subscriptions in 
`org.apache.pulsar.broker.admin.impl.PersistentTopicsBase#createMissedSubscriptionsAsync`~
   
   



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