joshelser commented on a change in pull request #740: HBASE-23197 
'IllegalArgumentException: Wrong FS' on edits replay when…
URL: https://github.com/apache/hbase/pull/740#discussion_r337099365
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java
 ##########
 @@ -314,9 +316,15 @@ public static void archiveStoreFiles(Configuration conf, 
FileSystem fs, RegionIn
     // build the archive path
     if (regionInfo == null || family == null) throw new IOException(
         "Need to have a region and a family to archive from.");
-
-    Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, 
regionInfo, tableDir, family);
-
+    String workingDir = conf.get(CommonFSUtils.HBASE_WAL_DIR);
+    Path rootDir = null;
+    if(workingDir == null || !workingDir.startsWith(fs.getScheme())){
+      workingDir = conf.get(HConstants.HBASE_DIR);
+    }
+    workingDir = workingDir.substring(workingDir.lastIndexOf("/"));
 
 Review comment:
   What happens if I give 
`hbase.wal.dir=hdfs://127.0.0.1:8020/nested/hbase/wals`. This logic breaks, 
right?
   
   `Path` has some methods (`isAbsolute()`, `isRoot()`) which, I think, would 
help the check you're trying to do here.
   
   A comment would help here since we're using this method that is for 
"storeFiles" for something that isn't a storefile.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to