Denovo1998 opened a new pull request, #26110:
URL: https://github.com/apache/pulsar/pull/26110

   ### Motivation
   
   PR #26044 made topic policy listeners buffer live updates until the initial 
topic-policy load completes, so a topic can start with the latest policy state. 
However, `PersistentTopic.initialize()` logs and continues when that initial 
load fails. In that path, the listener wrapper stays uninitialized, so later 
live topic-policy updates are buffered forever instead of being delivered to 
the topic.
   
   ### Modifications
   
   - Complete the `TopicPolicyListenerWrapper` with empty loaded policies when 
the initial global/local topic-policy lookup fails.
   - Preserve the original failed future so topic loading keeps the existing 
log-and-continue behavior.
   - Keep buffered live updates authoritative if an update arrives before the 
failure handling runs.
   - Add a regression test for initial policy load failure followed by a live 
local topic-policy update.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   - gradlew :pulsar-broker:test --tests 
org.apache.pulsar.broker.service.persistent.PersistentTopicTest.testTopicPolicyListenerForwardsLiveUpdatesAfterInitialLoadFailure
 --rerun-tasks
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment


-- 
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]

Reply via email to