Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition of the SystemTopicBasedTopicPoliciesService (apach…
…e#11097) ### Motivation Currently, we are triggering the reader to read more messages not waiting for the init policies cache to complete, This might lead to the init process got hasMessages=true but not able to read the message since the message has been consumed by the read more entries process will lead to the `topic policy cache not init` exception. Here are the details of the race condition: https://github.com/apache/pulsar/blob/0b67438d23bbbc46b500e896a18aad715a514fd9/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java#L190 https://github.com/apache/pulsar/blob/0b67438d23bbbc46b500e896a18aad715a514fd9/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java#L248 https://github.com/apache/pulsar/blob/0b67438d23bbbc46b500e896a18aad715a514fd9/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java#L275
- Loading branch information