codelipenghui commented on code in PR #21041:
URL: https://github.com/apache/pulsar/pull/21041#discussion_r1300297411
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -3506,15 +3505,13 @@ public void onUpdate(TopicPolicies policies) {
replicators.forEach((name, replicator) ->
replicator.updateRateLimiter());
shadowReplicators.forEach((name, replicator) ->
replicator.updateRateLimiter());
checkMessageExpiry();
- checkReplicationAndRetryOnFailure();
-
- checkDeduplicationStatus();
-
- preCreateSubscriptionForCompactionIfNeeded();
-
- // update managed ledger config
- checkPersistencePolicies();
- }).exceptionally(e -> {
+ })
+ .thenCompose(__ -> checkReplicationAndRetryOnFailure())
+ .thenCompose(__ -> checkDeduplicationStatus())
+ .thenCompose(__ -> preCreateSubscriptionForCompactionIfNeeded())
+ .thenCompose(__ -> checkPersistencePolicies())
Review Comment:
The second issue said there are exceptions that happened when calling
`checkPersistencePolicies`. Can we confirm that?
And is it possible that no exceptions happening on checkPersistencePolicies
but the topic is loaded before the topic policy is loaded? And the trim task
also happened before the topic policy is loaded.
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesServiceTest.java:
##########
@@ -457,4 +459,27 @@ public void testGetTopicPoliciesWithCleanCache() throws
Exception {
result.join();
}
+
+ @Test
+ public void testConfig() throws Exception {
Review Comment:
The test can also get passed without this change.
--
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]