You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "hemantk-12 (via GitHub)" <gi...@apache.org> on 2023/08/08 18:13:56 UTC

[GitHub] [ozone] hemantk-12 commented on a diff in pull request #5155: HDDS-9126. [Snapshot] SstFilteringService throws Exception while processing deleted snapshots.

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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org