Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.hdds.HddsConfigKeys;
import org.apache.hadoop.hdds.HddsUtils;
Expand Down Expand Up @@ -555,6 +556,7 @@ public File getLastKnownDB(File reconDbDir, String fileNamePrefix) {
}
} catch (NumberFormatException nfEx) {
log.warn("Unknown file found in Recon DB dir : {}", fileName);
FileUtils.deleteQuietly(snapshotFile);
Comment on lines 558 to +559
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should have changed the logging as well to say:

Deleting unknown file found in Recon DB dir

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ connectionFactory, getOzoneManagerSnapshotUrl(),
// Untar the checkpoint file.
Path untarredDbDir = Paths.get(omSnapshotDBParentDir.getAbsolutePath(), snapshotFileName);
reconUtils.untarCheckpointFile(targetFile, untarredDbDir);
FileUtils.deleteQuietly(targetFile);

// Validate the presence of required SST files
File[] sstFiles = untarredDbDir.toFile().listFiles((dir, name) -> name.endsWith(".sst"));
Expand All @@ -430,6 +429,8 @@ connectionFactory, getOzoneManagerSnapshotUrl(),
LOG.error("Unable to obtain Ozone Manager DB Snapshot. ", e);
reconContext.updateHealthStatus(new AtomicBoolean(false));
reconContext.updateErrors(ReconContext.ErrorCode.GET_OM_DB_SNAPSHOT_FAILED);
} finally {
FileUtils.deleteQuietly(targetFile);
}
return null;
}
Expand Down