bharanic-dev opened a new pull request #11157:
URL: https://github.com/apache/pulsar/pull/11157


   Fixes #11153
   
   ### Motivation
   
   There is a race condition between the admin API handler updating the cache 
with the latest changes and the metadata-store get()/getAsync() API. If the get 
API hits the cache, it fails to register a watch event for future updates. This 
results in watch events getting missed.
   
   ### Modifications
   
   The admin API handler should not update the cache. This results in the 
metadata-store get()/getAsync() API lazily populating the cache via 
asyncReload().
   
   Fix is to not update the cache in admin API handler.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   - [x] Added unit test to verify change. Without the fix, the unit test would 
fail.
   
   
   This change added tests and can be verified as follows:
   
   Added test 
`org.apache.pulsar.broker.resourcegroup.ResourceGroupConfigListenerTest#testResourceGroupUpdateLoop`
 to verify the changes. The test can be run using mvn command:
   
   mvn test 
-Dtest=org.apache.pulsar.broker.resourcegroup.ResourceGroupConfigListenerTest#testResourceGroupUpdateLoop
 -pl pulsar-broker
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
   
   this is a bug fix and has no user visible change (except that the issue is 
fixed). There is no documentation impact.


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