lhotari commented on code in PR #23094: URL: https://github.com/apache/pulsar/pull/23094#discussion_r1695596846
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java: ########## @@ -771,8 +782,13 @@ private CompletableFuture<Void> filterAndUnloadMatchedNamespaceAsync(NamespaceIs .map(tenant -> adminClient.namespaces().getNamespacesAsync(tenant)); return FutureUtil.waitForAll(completableFutureStream) .thenApply(namespaces -> { - // if namespace match any policy regex, add it to ns list to be unload. + // Filter namespaces that have current cluster in their replication_clusters + // if namespace match any policy regex, add it to ns list to be unloaded. return namespaces.stream() + .filter(namespaceName -> adminClient.namespaces() + .getPoliciesAsync(namespaceName) + .thenApply(policies -> policies.replication_clusters.contains(cluster)) + .join()) Review Comment: this would be a blocking operation. it would be better to make it asynchronous. -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org