315157973 commented on a change in pull request #12136:
URL: https://github.com/apache/pulsar/pull/12136#discussion_r716132723
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -1334,33 +1335,37 @@ public void closeFailed(ManagedLedgerException
exception, Object ctx) {
log.debug("[{}] Checking replication status", name);
}
- CompletableFuture<Policies> policiesFuture =
brokerService.pulsar().getPulsarResources()
- .getNamespaceResources()
- .getPoliciesAsync(TopicName.get(topic).getNamespaceObject())
- .thenCompose(optPolicies -> {
- if (!optPolicies.isPresent()) {
- return FutureUtil.failedFuture(
- new ServerMetadataException(
- new
MetadataStoreException.NotFoundException()));
- }
+ CompletableFuture<List<String>> replicationClustersFuture =
brokerService.pulsar()
+ .getTopicPoliciesService()
+ .getTopicPoliciesAsyncWithRetry(name, null,
brokerService.pulsar().getExecutor())
+ .thenCompose(topicPolicies -> {
+ if (!topicPolicies.isPresent()
+ ||
CollectionUtils.isEmpty(topicPolicies.get().getReplicationClusters())) {
Review comment:
We need to define the state:
null means no setting
The list is Empty, which means that the value is not set, that is, the
policies of this Topic under Namespace is disabled
If empty also means that there is no setting, subsequent Topic-level
Policies cannot be disabled
--
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]