poorbarcode commented on code in PR #21212:
URL: https://github.com/apache/pulsar/pull/21212#discussion_r1338400451
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -3565,10 +3566,11 @@ private CompletableFuture<Void>
updateSubscriptionsDispatcherRateLimiter() {
protected CompletableFuture<Void> initTopicPolicy() {
if (brokerService.pulsar().getConfig().isSystemTopicEnabled()
&&
brokerService.pulsar().getConfig().isTopicLevelPoliciesEnabled()) {
- return CompletableFuture.completedFuture(null).thenRunAsync(() ->
onUpdate(
- brokerService.getPulsar().getTopicPoliciesService()
-
.getTopicPoliciesIfExists(TopicName.getPartitionedTopicName(topic))),
- brokerService.getTopicOrderedExecutor());
+ return CompletableFuture.completedFuture(null).thenRunAsync(() -> {
+ TopicPoliciesService topicPoliciesService =
brokerService.getPulsar().getTopicPoliciesService();
+
onUpdate(topicPoliciesService.getLocalTopicPoliciesIfExists(TopicName.getPartitionedTopicName(topic)));
+
onUpdate(topicPoliciesService.getGlobalTopicPoliciesIfExists(TopicName.getPartitionedTopicName(topic)));
Review Comment:
This change fixed the bug that the global policies were discarded when
loading a topic up. We also need to add a test to cover this fix. The test flow
should be like this:
- create a topic and unload it
- set global policies
- start a consumer/producer to load the topic up
- ensure the global policies affect the topic
--
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]