From edd8578a1a7a9f5f116273fde75620789886fb59 Mon Sep 17 00:00:00 2001 From: Jiwe Guo Date: Thu, 11 Jan 2024 21:10:14 +0800 Subject: [PATCH] fix --- .../org/apache/pulsar/broker/service/BrokerService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java index ae7744fef7cdec..388e8f2f32af20 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java @@ -1055,7 +1055,7 @@ public CompletableFuture> getTopic(final TopicName topicName, bo private CompletableFuture> getTopicPoliciesBypassSystemTopic(@Nonnull TopicName topicName) { Objects.requireNonNull(topicName); final ServiceConfiguration serviceConfiguration = pulsar.getConfiguration(); - if (serviceConfiguration.isSystemTopicEnabled() && serviceConfiguration.isTopicLevelPoliciesEnabled() + if (serviceConfiguration.isSystemTopicAndTopicLevelPoliciesEnabled() && !NamespaceService.isSystemServiceNamespace(topicName.getNamespace()) && !SystemTopicNames.isTopicPoliciesSystemTopic(topicName.toString())) { return pulsar.getTopicPoliciesService().getTopicPoliciesAsync(topicName); @@ -3446,7 +3446,7 @@ public boolean isSystemTopic(TopicName topicName) { * @return TopicPolicies, if they exist. Otherwise, the value will not be present. */ public Optional getTopicPolicies(TopicName topicName) { - if (!pulsar().getConfig().isTopicLevelPoliciesEnabled()) { + if (!pulsar().getConfig().isSystemTopicAndTopicLevelPoliciesEnabled()) { return Optional.empty(); } return Optional.ofNullable(pulsar.getTopicPoliciesService() @@ -3455,7 +3455,7 @@ public Optional getTopicPolicies(TopicName topicName) { public CompletableFuture deleteTopicPolicies(TopicName topicName) { final PulsarService pulsarService = pulsar(); - if (!pulsarService.getConfig().isTopicLevelPoliciesEnabled()) { + if (!pulsarService.getConfig().isSystemTopicAndTopicLevelPoliciesEnabled()) { return CompletableFuture.completedFuture(null); } return pulsar.getTopicPoliciesService()