merlimat commented on a change in pull request #14283:
URL: https://github.com/apache/pulsar/pull/14283#discussion_r806486571



##########
File path: 
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/cache/impl/MetadataCacheImpl.java
##########
@@ -261,12 +268,17 @@ public void invalidate(String path) {
     }
 
     @Override
-    public void refresh(String path) {
+    public CompletableFuture<Void> refresh(String path) {
         // Refresh object of path if only it is cached before.
-        if (objCache.getIfPresent(path) != null) {
-            objCache.synchronous().invalidate(path);
-            objCache.synchronous().refresh(path);
-        }
+        CompletableFuture<Void> promise = new CompletableFuture<>();
+        scheduler.executeOrdered(path, () -> {

Review comment:
       @codelipenghui the invalidate is just removing form the local cache map 
so it's not blocking. `refresh()` will initiate the refilling of the cache in 
background and will not block either.




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