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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/defrag/SnapshotDefragService.java:
##########
@@ -574,19 +574,36 @@ OmMetadataManagerImpl createCheckpoint(SnapshotInfo 
snapshotInfo,
     try (UncheckedAutoCloseableSupplier<OmSnapshot> snapshot = 
omSnapshotManager.getActiveSnapshot(
         snapshotInfo.getVolumeName(), snapshotInfo.getBucketName(), 
snapshotInfo.getName())) {
       DBCheckpoint checkpoint = 
snapshot.get().getMetadataManager().getStore().getCheckpoint(tmpDefragDir, 
true);
-      try (OmMetadataManagerImpl metadataManagerBeforeTruncate =
-               createDefragCheckpointMetadataManager(checkpoint, false)) {
-        DBStore dbStore = metadataManagerBeforeTruncate.getStore();
-        for (String table : metadataManagerBeforeTruncate.listTableNames()) {
-          if (!incrementalColumnFamilies.contains(table)) {
-            dbStore.dropTable(table);
+      Path checkpointLocation = checkpoint.getCheckpointLocation();

Review Comment:
   getCheckpoint() can return null after it catches an IOException. This line 
then throws NPE. The new cleanup block does not run, and 
triggerSnapshotDefragOnce() does not catch this exception. Pls report this 
failure as an IOException, delete any partial checkpoint directory, and add a 
test for this path.



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