jojochuang commented on code in PR #9869:
URL: https://github.com/apache/ozone/pull/9869#discussion_r2898277815


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:
##########
@@ -158,6 +158,7 @@ public void invalidate(UUID key) {
         }
         omMetrics.decNumSnapshotCacheSize();
       }
+      pendingEvictionQueue.remove(k);

Review Comment:
   note: this case should not happen during checkpointing, because checkpoints 
holds a write lock of the snapshot cache, and once released, it invokes 
cleanup() immediately.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:
##########
@@ -158,6 +158,7 @@ public void invalidate(UUID key) {
         }
         omMetrics.decNumSnapshotCacheSize();
       }
+      pendingEvictionQueue.remove(k);

Review Comment:
   pendingEvictionQueue may have the entry k, if snapshot purge response is 
happening after, and all references of the snapshot is decremented (releasing 
the SnapshotCache lock of the key), but before the periodic cleanup thread 
kicks in.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:
##########


Review Comment:
   SnapshotCache.invalidate() is called during OMSnapshotPurgeResponse.
   
   



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:
##########
@@ -323,8 +324,13 @@ private UncheckedAutoCloseableSupplier<OMLockDetails> 
lock(Supplier<OMLockDetail
 
     AtomicReference<OMLockDetails> lockDetails = new 
AtomicReference<>(emptyLockFunction.get());
     if (lockDetails.get().isLockAcquired()) {
-      if (!cleanupFunction.get()) {

Review Comment:
   the lock is released by calling emptyUnlockFunction.get(), if cleanup 
operation was not successful or if it throws a Throwable.



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