hemantk-12 commented on code in PR #3980:
URL: https://github.com/apache/ozone/pull/3980#discussion_r1034296160


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -3568,7 +3570,7 @@ private DBCheckpoint getDBCheckpointFromLeader(String 
leaderId) {
         "from the checkpoint.", leaderId);
 
     try {
-      return omSnapshotProvider.getOzoneManagerDBSnapshot(leaderId);
+      return omRatisSnapshotProvider.getOzoneManagerDBSnapshot(leaderId);

Review Comment:
   Sorry about wrong function name. Inside `installSnapshotFromLeader`, we have 
following line:
   
   ```
   DBCheckpoint omDBCheckpoint = getDBCheckpointFromLeader(leaderId);
   LOG.info("Downloaded checkpoint from Leader {} to the location {}",
       leaderId, omDBCheckpoint.getCheckpointLocation());
   ```
   
   It will throw NPE in log statement at 
`omDBCheckpoint.getCheckpointLocation()`, if `omDBCheckpoint` is null.



##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -164,19 +164,19 @@ public RocksDBCheckpointDiffer(String metadataDir, String 
sstBackupDir,
     this.activeDBLocationStr = activeDBLocation.toString() + "/";
   }
 
-  private void setCompactionLogDir(String metadataDir,
+  private void setCompactionLogDir(String snapshotDiffDir,
       String compactionLogDirName) {
 
-    final File parentDir = new File(metadataDir);
+    final File parentDir = new File(snapshotDiffDir);
     if (!parentDir.exists()) {
-      if (!parentDir.mkdir()) {
+      if (!parentDir.mkdirs()) {
         LOG.error("Error creating compaction log parent dir.");
         return;
       }
     }
 
     this.compactionLogDir =
-        Paths.get(metadataDir, compactionLogDirName).toString();
+        Paths.get(parentDir.toString(), compactionLogDirName).toString();

Review Comment:
   I meant 
[File.getPath()](https://docs.oracle.com/javase/7/docs/api/java/io/File.html#getPath()).
 `File.toString()` internally calls `File.getPath()`.



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