Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-26106

AbstractFSWALProvider#getArchivedLogPath doesn't look for wal file in all oldWALs directory.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.0.0-alpha-1, 2.5.0, 2.4.4
    • 2.5.0, 3.0.0-alpha-2, 2.4.6
    • wal
    • 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

      ReplicationSource#getFileSize

      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

          Activity

            People

              shahrs87 Rushabh Shah
              shahrs87 Rushabh Shah
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: