infraio commented on a change in pull request #330: HBASE-22617 Recovered WAL 
directories not getting cleaned up
URL: https://github.com/apache/hbase/pull/330#discussion_r296585840
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitUtil.java
 ##########
 @@ -247,10 +248,49 @@ public static boolean hasRecoveredEdits(final 
Configuration conf, final RegionIn
     }
     // Only default replica region can reach here, so we can use regioninfo
     // directly without converting it to default replica's regioninfo.
-    Path regionDir =
-        FSUtils.getWALRegionDir(conf, regionInfo.getTable(), 
regionInfo.getEncodedName());
-    NavigableSet<Path> files = 
getSplitEditFilesSorted(FSUtils.getWALFileSystem(conf), regionDir);
-    return files != null && !files.isEmpty();
+    Path regionWALDir =
+      FSUtils.getWALRegionDir(conf, regionInfo.getTable(), 
regionInfo.getEncodedName());
+    Path regionDir = FSUtils.getRegionDirFromRootDir(FSUtils.getRootDir(conf), 
regionInfo);
+    Path wrongRegionWALDir =
+      FSUtils.getWrongWALRegionDir(conf, regionInfo.getTable(), 
regionInfo.getEncodedName());
+    NavigableSet<Path> files =
+      getSplitEditFilesSorted(FSUtils.getWALFileSystem(conf), regionWALDir);
+    if (!files.isEmpty()) {
+      return true;
+    }
+    files = getSplitEditFilesSorted(FSUtils.getWALFileSystem(conf), regionDir);
 
 Review comment:
   Should be getFileSystem here?

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