lhotari commented on code in PR #23100:
URL: https://github.com/apache/pulsar/pull/23100#discussion_r1696703055
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:
##########
@@ -771,10 +772,15 @@ 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 ->
policyData.getNamespaces().stream().anyMatch(namespaceName::matches))
+ .filter(namespaceName ->
adminClient.namespaces()
+
.getPoliciesAsync(namespaceName)
+ .thenApply(policies ->
policies.replication_clusters.contains(cluster))
+ .join())
Review Comment:
This is a blocking operation. I'll push a commit to this PR to show how 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]