You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "zymap (via GitHub)" <gi...@apache.org> on 2023/08/24 01:52:49 UTC

[GitHub] [pulsar] zymap commented on a diff in pull request #21035: [fix] [bk] Correctct the bookie info after ZK client is reconnected

zymap commented on code in PR #21035:
URL: https://github.com/apache/pulsar/pull/21035#discussion_r1303700396


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarRegistrationClient.java:
##########
@@ -88,13 +91,29 @@ public PulsarRegistrationClient(MetadataStore store,
                 .newSingleThreadScheduledExecutor(new DefaultThreadFactory("pulsar-registration-client"));
 
         store.registerListener(this::updatedBookies);
+        this.store.registerSessionListener(this::refreshBookies);
     }
 
     @Override
     public void close() {
         executor.shutdownNow();
     }
 
+    private void refreshBookies(SessionEvent sessionEvent) {
+        lastMetadataSessionEvent = sessionEvent;
+        if (!SessionEvent.Reconnected.equals(sessionEvent)){

Review Comment:
   Do we need to invalidate the cache if the event is `SessionReestablished`?



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org