hemantk-12 commented on code in PR #5155:
URL: https://github.com/apache/ozone/pull/5155#discussion_r1287487164


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java:
##########
@@ -564,6 +569,14 @@ public void submitRequest(OMRequest omRequest) {
     }
   }
 
+  public static boolean shouldIgnoreSnapshot(SnapshotInfo snapInfo,
+      SnapshotInfo.SnapshotStatus snapshotStatus,
+      boolean isSstFilteringServiceEnabled) {
+    return !snapshotStatus.equals(
+        SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED)
+        || (isSstFilteringServiceEnabled && !snapInfo.isSstFiltered());

Review Comment:
   What is `(isSstFilteringServiceEnabled && !snapInfo.isSstFiltered());` check 
doing? It is saying that you will try to clean up a snapshot if SST filtering 
service is enabled but snapshot is not filtered. 



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java:
##########
@@ -564,6 +569,14 @@ public void submitRequest(OMRequest omRequest) {
     }
   }
 
+  public static boolean shouldIgnoreSnapshot(SnapshotInfo snapInfo,
+      SnapshotInfo.SnapshotStatus snapshotStatus,
+      boolean isSstFilteringServiceEnabled) {
+    return !snapshotStatus.equals(

Review Comment:
   nit: use `==` for enum comparison to avoid null checks.
   
   ```suggestion
       return !snapshotStatus.equals(
           SnapshotInfo.SnapshotStatus.SNAPSHOT_DELETED)
   ``` 



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java:
##########
@@ -181,15 +193,17 @@ public BackgroundTaskResult call() throws Exception {
           List<Pair<String, String>> prefixPairs =
               constructPrefixPairs(snapshotInfo);
 
-          try (ReferenceCounted<IOmMetadataReader, SnapshotCache>
-                   snapshotMetadataReader = snapshotCache.get()
-              .get(snapshotInfo.getTableKey())) {
+          try (
+              ReferenceCounted<IOmMetadataReader, SnapshotCache>

Review Comment:
   Description says "SSTFiltering service should only operate on active 
snapshots." but here you are skipping the active snapshot check. Which means 
you will still load snapshot even if it is not ACTIVE. It is not what 
description says. Please either update the description or remove the 
`skipActiveCheck`. 



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