SaketaChalamchala commented on code in PR #10774:
URL: https://github.com/apache/ozone/pull/10774#discussion_r3618483236


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/defrag/SnapshotDefragService.java:
##########
@@ -723,7 +730,24 @@ boolean checkAndDefragSnapshot(SnapshotChainManager 
chainManager, UUID snapshotI
       }
     } finally {
       if (checkpointMetadataManager != null) {
-        checkpointMetadataManager.close();
+        try {
+          checkpointMetadataManager.close();
+        } catch (IOException closeException) {
+          LOG.error("Failed to close checkpoint metadata manager for snapshot: 
{} (ID: {})",
+              snapshotInfo.getTableKey(), snapshotInfo.getSnapshotId(), 
closeException);
+        }
+      }
+      if (defragSuccessful && checkpointLocation.toFile().exists()) {

Review Comment:
   Thanks for the patch @cchung100m. Shouldn't this be `!defragSuccessful `?
   
   ```suggestion
         if (!defragSuccessful && checkpointLocation.toFile().exists()) {
   ```



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