divijvaidya commented on code in PR #13947:
URL: https://github.com/apache/kafka/pull/13947#discussion_r1299870642


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java:
##########
@@ -166,6 +166,10 @@ public Cache<Uuid, Entry> internalCache() {
         return internalCache;
     }
 
+    public void remove(Uuid key) {

Review Comment:
   Nope. Write lock is not needed here folks. This is because the cache is 
thread-safe i.e. the caffeine interface internally ensures that multiple 
threads can read/write to it at the same time. 
   
   We use a lock here to ensure that "close" mention of the RemoteIndeCache can 
execute in isolation i.e. no other method is called when this cache is being 
closed. That is why a read lock will suffice. 
   
   Is this makes sense to you, I will create a JIRa and fix it. ok @satishd 
@kamalcph ?



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to