Jason918 commented on a change in pull request #12896:
URL: https://github.com/apache/pulsar/pull/12896#discussion_r755914748
##########
File path:
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/cache/impl/MetadataCacheImpl.java
##########
@@ -261,8 +261,11 @@ public void invalidate(String path) {
@Override
public void refresh(String path) {
- objCache.synchronous().invalidate(path);
- objCache.synchronous().refresh(path);
+ // Refresh object of path if only it is cached before.
+ if (objCache.getIfPresent(path) != null) {
Review comment:
> I'm just wondering if there's a possibility for races.
No, it's ok to miss a refresh or duplicate a refresh. Worst case is you have
to do an extra loading when calling get.
--
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]