You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/05/26 14:56:13 UTC

[GitHub] [pulsar] MarvinCai commented on a change in pull request #10707: force to refresh partition metadata info

MarvinCai commented on a change in pull request #10707:
URL: https://github.com/apache/pulsar/pull/10707#discussion_r639808851



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java
##########
@@ -86,6 +86,13 @@ public BaseResources(MetadataStoreExtended store, TypeReference<T> typeRef, int
         return cache.get(path);
     }
 
+    public CompletableFuture<Optional<T>> getAsync(String path, boolean forceRefresh) {
+        if (forceRefresh) {

Review comment:
       It's this just defeating the purpose of using cache if we invalidate the entry before try to access it?
   Theoretically not just partitioned topic but all other metadata can have this problem.
   It seems the `MetadataCacheImpl` implements `Consumer<Notification>` which should properly invalidate the cache entry if path is  deleted, but it's somehow not added to `listeners` in `AbstractMetadataStore`, maybe fixing this can fix our problem?




-- 
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:
users@infra.apache.org