lhotari commented on code in PR #17401:
URL: https://github.com/apache/pulsar/pull/17401#discussion_r966610950


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/LeaderElectionImpl.java:
##########
@@ -207,11 +219,6 @@ private synchronized 
CompletableFuture<LeaderElectionState> tryToBecomeLeader()
                         // There was a conflict between 2 participants trying 
to become leaders at same time. Retry
                         // to fetch info on new leader.
 
-                        // We force the invalidation of the cache entry. Since 
we received a BadVersion error, we
-                        // already know that the entry is out of date. If we 
don't invalidate, we'd be retrying the
-                        // leader election many times until we finally receive 
the notification that invalidates the
-                        // cache.
-                        cache.invalidate(path);

Review Comment:
   This is taken care of in `elect` method. It uses `store.get` and by-passes 
the cache. There's `cache.refresh(path);` to invalidate the stale value. 



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