Denovo1998 commented on code in PR #24286:
URL: https://github.com/apache/pulsar/pull/24286#discussion_r2254283792


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java:
##########
@@ -218,6 +218,25 @@ private CompletableFuture<Void> 
sendTopicPolicyEvent(TopicName topicName, Action
                 });
     }
 
+    private CompletableFuture<MessageId> 
sendTopicPolicyEventInternal(TopicName topicName, ActionType actionType,
+                                      SystemTopicClient.Writer<PulsarEvent> 
writer,
+                                      @Nullable TopicPolicies policies) {
+        PulsarEvent event = getPulsarEvent(topicName, actionType, policies);
+        if (!ActionType.DELETE.equals(actionType)) {
+            return writer.writeAsync(getEventKey(event, policies != null && 
policies.isGlobalPolicies()), event);
+        }
+        // When a topic is deleting, delete both non-global and global 
topic-level policies.
+        CompletableFuture<MessageId> deletePolicies = 
writer.deleteAsync(getEventKey(event, true), event)
+            .thenCompose(__ -> {
+                return writer.deleteAsync(getEventKey(event, false), event);
+            });

Review Comment:
   Of course, you can submit a small PR later.



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