GeorgeJahad commented on code in PR #5104:
URL: https://github.com/apache/ozone/pull/5104#discussion_r1271372651


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServlet.java:
##########
@@ -175,23 +188,94 @@ public static Set<Path> normalizeExcludeList(List<String> 
toExcludeList,
     return paths;
   }
 
+  @Override
+  // Pauses rocksdb compaction threads while creating copies of
+  // compaction logs and hard links of sst backups.
+  public DBCheckpoint getCheckpoint(Path tmpdir, boolean flush)
+      throws IOException {
+    DBCheckpoint checkpoint;
+
+    // make tmp directories to contain the copies
+    RocksDBCheckpointDiffer differ = getDbStore().getRocksDBCheckpointDiffer();
+    DirectoryData sstBackupDir = new DirectoryData(tmpdir,
+        differ.getSSTBackupDir());
+    DirectoryData compactionLogDir = new DirectoryData(tmpdir,
+        differ.getCompactionLogDir());
+    if (!sstBackupDir.getTmpDir().mkdirs()) {
+      throw new IOException("mkdirs failed: " + sstBackupDir.getTmpDir());
+    }
+    if (!compactionLogDir.getTmpDir().mkdirs()) {
+      throw new IOException("mkdirs failed: " + compactionLogDir.getTmpDir());
+    }
+
+    long startTime = System.currentTimeMillis();
+    long pauseCounter = PAUSE_COUNTER.incrementAndGet();
+
+    // Pause compactions, Copy/link files and get checkpoint.
+    try {
+      LOG.info("Compaction pausing {} started.", pauseCounter);
+      differ.incrementTarballRequestCount();
+      FileUtils.copyDirectory(compactionLogDir.getDir(),

Review Comment:
   Link files is not making a copy, it is linking each individual sst file in 
the old directory to the new directory, (which is what we want for the sst 
files.)  For the compaction logs we want copies.



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