Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
3.0.0-alpha-1, 2.5.0, 2.4.4
-
None
-
Reviewed
Description
Below is the code for AbstractFSWALProvider#getArchivedLogPath
public static Path getArchivedLogPath(Path path, Configuration conf) throws IOException { Path rootDir = CommonFSUtils.getWALRootDir(conf); Path oldLogDir = new Path(rootDir, HConstants.HREGION_OLDLOGDIR_NAME); if (conf.getBoolean(SEPARATE_OLDLOGDIR, DEFAULT_SEPARATE_OLDLOGDIR)) { ServerName serverName = getServerNameFromWALDirectoryName(path); if (serverName == null) { LOG.error("Couldn't locate log: " + path); return path; } oldLogDir = new Path(oldLogDir, serverName.getServerName()); } Path archivedLogLocation = new Path(oldLogDir, path.getName()); final FileSystem fs = CommonFSUtils.getWALFileSystem(conf); if (fs.exists(archivedLogLocation)) { LOG.info("Log " + path + " was moved to " + archivedLogLocation); return archivedLogLocation; } else { LOG.error("Couldn't locate log: " + path); return path; } }
This method is called from the following places.
AbstractFSWALProvider#openReader
WALInputFormat.WALRecordReader#nextKeyValue
All of the above calls are trying to find the log in archive path after they couldn't locate the wal in walsDir and they are not used for moving a log file to archive directory.
But we will look for archive path within serverName directory only if conf key is true.
Cc zhangduo
Attachments
Issue Links
- links to