swamirishi commented on code in PR #9169:
URL: https://github.com/apache/ozone/pull/9169#discussion_r2441252379
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServletInodeBasedXfer.java:
##########
@@ -486,13 +487,28 @@ private boolean writeDBToArchive(Set<String>
sstFilesToExclude, Path dbDir, Atom
*/
private DBCheckpoint createAndPrepareCheckpoint(Path tmpdir, boolean flush)
throws IOException {
// make tmp directories to contain the copies
- Path tmpCompactionLogDir =
tmpdir.resolve(getCompactionLogDir().getFileName());
Path tmpSstBackupDir = tmpdir.resolve(getSstBackupDir().getFileName());
+ Files.createDirectories(tmpSstBackupDir);
- // Create checkpoint and then copy the files so that it has all the
compaction entries and files.
+ // Create checkpoint.
DBCheckpoint dbCheckpoint = getDbStore().getCheckpoint(flush);
- FileUtils.copyDirectory(getCompactionLogDir().toFile(),
tmpCompactionLogDir.toFile());
- OmSnapshotUtils.linkFiles(getSstBackupDir().toFile(),
tmpSstBackupDir.toFile());
+
+ try {
+ RocksDBCheckpointDiffer differ =
getDbStore().getRocksDBCheckpointDiffer();
+ List<String> sstFiles =
+
differ.getCompactionLogSstFiles(dbCheckpoint.getCheckpointLocation());
+ for (String sstFile : sstFiles) {
+ Path sstFileToLink = getSstBackupDir().resolve(sstFile);
+ if (Files.exists(sstFileToLink)) {
+ Files.createLink(tmpSstBackupDir.resolve(sstFile), sstFileToLink);
Review Comment:
We don't need to create SstFileLinks we can directly read it and write it to
the tar archive stream
--
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]