Skip to content

Commit

Permalink
[fix][broker] Fix topic policies cannot be queried with extensible lo…
Browse files Browse the repository at this point in the history
…ad manager
  • Loading branch information
BewareMyPower committed Sep 20, 2024
1 parent 4b3b273 commit da288b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public void cleanOwnerships() {

@Override
public synchronized boolean started() {
return validateChannelState(LeaderElectionServiceStarted, false);
return validateChannelState(Started, true);
}

public synchronized void start() throws PulsarServerException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3601,6 +3601,9 @@ private AutoTopicCreationOverride getAutoTopicCreationOverride(final TopicName t
public @Nonnull CompletableFuture<Boolean> isAllowAutoSubscriptionCreationAsync(@Nonnull TopicName tpName) {
requireNonNull(tpName);
// Policies priority: topic level -> namespace level -> broker level
if (ExtensibleLoadManagerImpl.isInternalTopic(tpName.toString())) {
return CompletableFuture.completedFuture(true);
}
return pulsar.getTopicPoliciesService()
.getTopicPoliciesAsync(tpName, TopicPoliciesService.GetType.LOCAL_ONLY)
.thenCompose(optionalTopicPolicies -> {
Expand Down

0 comments on commit da288b5

Please sign in to comment.