Yiran-wu commented on code in PR #6856:
URL: https://github.com/apache/hbase/pull/6856#discussion_r2026313129


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractFSWALProvider.java:
##########
@@ -448,10 +497,6 @@ public static boolean isArchivedLogFile(Path p) {
    * @throws IOException exception
    */
   public static Path findArchivedLog(Path path, Configuration conf) throws 
IOException {
-    // If the path contains oldWALs keyword then exit early.

Review Comment:
   If we add this check, the correct location of the WAL file will not be found 
when the separated oldWALs feature is turned on。
   
   In the process of restoring a WAL, execution node will attempt to open a WAL 
file, but because a WAL file has been moved to 
"/hbase/oldWALs/crash_servername_dir/“,   In the 
"AbstractProtobufWALReader.open", will execute the "openArchiveWAL" calls, and 
into the "findArchivedLong"  
   
   If the incoming path contains "oldWALs", null is returned directly.  The 
actual file location in the "/hbase/oldWALs/crash_servername_dir/”  
   
   When we cancel this check, we will be able to take advantage of the old 
directory lookup logic that starts at line 472 
   
   ```
   // some codes 
    oldLogDir = new Path(walRootDir, new 
StringBuilder(HConstants.HREGION_OLDLOGDIR_NAME)
         .append(Path.SEPARATOR).append(serverName.getServerName()).toString());
       archivedLogLocation = new Path(oldLogDir, path.getName());
       if (fs.exists(archivedLogLocation)) {
         LOG.info("Log " + path + " was moved to " + archivedLogLocation);
         return archivedLogLocation;
       }
   ```
   



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

Reply via email to