rdhabalia commented on a change in pull request #9351:
URL: https://github.com/apache/pulsar/pull/9351#discussion_r571231283



##########
File path: 
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/cache/impl/MetadataCacheImpl.java
##########
@@ -253,4 +255,23 @@ public void accept(Notification t) {
             break;
         }
     }
+
+    private CompletableFuture<Void> 
executeWithRetry(Supplier<CompletableFuture<Void>> op, String key) {
+        CompletableFuture<Void> result = new CompletableFuture<>();
+        op.get().thenAccept(r -> result.complete(null)).exceptionally((ex) -> {
+            if (ex.getCause() instanceof BadVersionException) {
+                // if resource is updated by other than metadata-cache then 
metadata-cache will get bad-version
+                // exception. so, try to invalidate the cache and try one more 
time.
+                objCache.synchronous().invalidate(key);

Review comment:
       no, it just cleans up the cache synchronously. 




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