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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -505,26 +505,29 @@ protected CompletableFuture<Void> 
internalUpdatePartitionedTopicAsync(int numPar
             });
     }
 
-    protected void internalCreateMissedPartitions(AsyncResponse asyncResponse) 
{
-        getPartitionedTopicMetadataAsync(topicName, false, 
false).thenAccept(metadata -> {
-            if (metadata != null) {
-                tryCreatePartitionsAsync(metadata.partitions).thenAccept(v -> {
+    protected void internalCreateMissedPartitions(AsyncResponse asyncResponse, 
List<String> subscriptions) {
+        getPartitionedTopicMetadataAsync(topicName, false, false)
+                .thenApply(metadata -> {
+                    if (metadata == null) {
+                        throw new RestException(Status.NOT_FOUND, 
String.format(
+                                "Partitioned Topic not found: %s ,has no 
metadata", topicName.toString()));
+                    }
+                    return metadata;
+                })
+                .thenCompose(metadata ->
+                        
tryCreatePartitionsAsync(metadata.partitions).thenApply(ignore -> 
metadata.partitions))

Review Comment:
   I have updated.PTAL @AnonHxy



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