nandakumar131 commented on code in PR #6962:
URL: https://github.com/apache/ozone/pull/6962#discussion_r1703485689


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/cache/FullTableCache.java:
##########
@@ -111,18 +116,31 @@ public void loadInitial(CacheKey<KEY> key, 
CacheValue<VALUE> value) {
   @Override
   public void put(CacheKey<KEY> cacheKey, CacheValue<VALUE> value) {
     try {
-      lock.writeLock().lock();
+      lock.readLock().lock();
       cache.put(cacheKey, value);
-      epochEntries.computeIfAbsent(value.getEpoch(),
-          v -> new CopyOnWriteArraySet<>()).add(cacheKey);
+      // add in case of null value for cleanup purpose only when key is deleted
+      if (value.getCacheValue() == null) {
+        epochEntries.computeIfAbsent(value.getEpoch(),
+            v -> new CopyOnWriteArraySet<>()).add(cacheKey);
+      }
     } finally {
-      lock.writeLock().unlock();
+      lock.readLock().unlock();
     }
   }
 
   @Override
   public void cleanup(List<Long> epochs) {
-    executorService.execute(() -> evictCache(epochs));
+    epochCleanupQueue.clear();

Review Comment:
   What will happen to the `epochs` that were there in the `epochCleanupQueue` 
which were not picked up by the `cleanupTasks`?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to