sursingh opened a new pull request #10862:
URL: https://github.com/apache/pulsar/pull/10862


   Fixes #10860
   
   ### Motivation
   
   When doing operations on multiple brokers, the state is not always 
consistent. Sometimes the operations don't seem to get replicated to other 
brokers in the cluster. The queries from the brokers returns different results. 
See #10860 for details
   
   ### Modifications
   
   1. While creating a new object, we add the object to cache. However we are 
not adding a watch on the corresponding path in zookeeper. So when other 
brokers change/delete the object, the broker that added the object is not 
notified. With this change we will do a get(), which will add a watch on the 
corresponding path. This will also add the object to the cache.
   
   2. Similarly while deleting, we are adding an empty object to the cache. Any 
local request will now return a `object not found` error, without needing to go 
the zookeeper. However if the object get re-added on any other broker, we will 
not be notified. We will continue to return `object not found` error, even 
though an instance of the object now exist. This change remove the addition of 
empty object to the cache. If a request is received for the object, we will do 
a get from the zookeeper and if it still doesn't exist, an empty object will 
get added. Also a watch will get added for the corresponding path. This will 
ensure that cache will get update the object is again added by some other 
broker.
   
   ### Verifying this change
   
   - Added a test case that clearly demonstrates the issue and ensured that 
behavior is fixed after the change
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to