aloyszhang opened a new pull request, #19501:
URL: https://github.com/apache/pulsar/pull/19501
### Motivation
Broker may throw the following exception when deleting topic
```shell
ERROR org.apache.pulsar.broker.admin.v2.PersistentTopics - [null] Failed to
delete topic persistent://test/test/t-partition-17
java.lang.UnsupportedOperationException: Topic policies service is disabled.
at
org.apache.pulsar.broker.service.TopicPoliciesService$TopicPoliciesServiceDisabled.deleteTopicPoliciesAsync(TopicPoliciesService.java:146)
~[pulsar-broker.jar:2.12.0-SNAPSHOT]
at
org.apache.pulsar.broker.service.BrokerService.deleteTopicPolicies(BrokerService.java:3345)
~[pulsar-broker.jar:2.12.0-SNAPSHOT]
at
org.apache.pulsar.broker.service.AbstractTopic.deleteTopicPolicies(AbstractTopic.java:1240)
~[pulsar-broker.jar:2.12.0-SNAPSHOT]
at
org.apache.pulsar.broker.service.persistent.PersistentTopic.lambda$delete$31(PersistentTopic.java:1247)
~[pulsar-broker.jar:2.12.0-SNAPSHOT]
at
java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
~[?:?]
at
java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
~[?:?]
at
org.apache.pulsar.broker.service.persistent.PersistentTopic.lambda$delete$36(PersistentTopic.java:1245)
~[pulsar-broker.jar:2.12.0-SNAPSHOT]
at
java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
~[?:?]
at
java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
~[?:?]
at
java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
~[?:?]
at
org.apache.pulsar.broker.service.persistent.PersistentTopic.lambda$delete$28(PersistentTopic.java:1232)
~[pulsar-broker.jar:2.12.0-SNAPSHOT]
at
java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:787)
~[?:?]
at
java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
~[?:?]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
~[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
~[?:?]
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
~[io.netty-netty-common-4.1.87.Final.jar:4.1.87.Final]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
```
This is caused by the configuration of `topicLevelPoliciesEnabled` and
`systemTopicEnabled` are not consistent.
### Modifications
unify topic-level policies enable judgment conditions
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
### Documentation
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions
will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since
the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed
in
a forked repository.
The tests will be run in the forked repository until all PR review comments
have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
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]