kamalcph commented on code in PR #14483:
URL: https://github.com/apache/kafka/pull/14483#discussion_r1349878452


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java:
##########
@@ -134,7 +134,7 @@ public RemoteIndexCache(int maxSize, RemoteStorageManager 
remoteStorageManager,
                 .maximumSize(maxSize)
                 // removeListener is invoked when either the entry is 
invalidated (means manual removal by the caller) or

Review Comment:
   Can we update the comment to refer the `evictionListener` instead of 
`removeListener`? 



##########
storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java:
##########
@@ -169,7 +169,16 @@ public Cache<Uuid, Entry> internalCache() {
     public void remove(Uuid key) {
         lock.readLock().lock();
         try {
-            internalCache.invalidate(key);
+            internalCache.asMap().computeIfPresent(key, (k, v) -> {
+                try {
+                    v.markForCleanup();
+                    v.cleanup();

Review Comment:
   Also, we have to add that entry to the `expiredIndexes` so that cleanup 
thread will be invoked on the removed entry.



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