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

Empty regionserver WAL will never be deleted although the coresponding regionserver has been stale

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • 1.0.2
    • None
    • wal
    • None

    Description

      When I restarted the hbase cluster in which there was few data, I found there are two directories for one host with different timestamp which indicates that the old regionserver wal directory is not deleted.
      FHLog#989

       @Override
        public void close() throws IOException {
          shutdown();
          final FileStatus[] files = getFiles();
          if (null != files && 0 != files.length) {
            for (FileStatus file : files) {
              Path p = getWALArchivePath(this.fullPathArchiveDir, file.getPath());
              // Tell our listeners that a log is going to be archived.
              if (!this.listeners.isEmpty()) {
                for (WALActionsListener i : this.listeners) {
                  i.preLogArchive(file.getPath(), p);
                }
              }
      
              if (!FSUtils.renameAndSetModifyTime(fs, file.getPath(), p)) {
                throw new IOException("Unable to rename " + file.getPath() + " to " + p);
              }
              // Tell our listeners that a log was archived.
              if (!this.listeners.isEmpty()) {
                for (WALActionsListener i : this.listeners) {
                  i.postLogArchive(file.getPath(), p);
                }
              }
            }
            LOG.debug("Moved " + files.length + " WAL file(s) to " +
              FSUtils.getPath(this.fullPathArchiveDir));
          }
          LOG.info("Closed WAL: " + toString());
        }
      

      When regionserver is stopped, the hlog will be archived, so wal/regionserver is empty in hdfs.

      MasterFileSystem#252

              if (curLogFiles == null || curLogFiles.length == 0) {
                  // Empty log folder. No recovery needed
                  continue;
                }
      

      The regionserver directory will be not splitted, it makes sense. But it will be not deleted.

      Attachments

        1. HBASE_14391_master_v4.patch
          0.8 kB
          Qianxi Zhang
        2. HBASE_14391_trunk_v1.patch
          0.7 kB
          Qianxi Zhang
        3. HBASE_14391_trunk_v2.patch
          0.7 kB
          Qianxi Zhang
        4. HBASE-14391-master-v3.patch
          0.7 kB
          Jerry He
        5. WALs-leftover-dir.txt
          14 kB
          Jerry He

        Activity

          People

            Unassigned Unassigned
            qianxiZhang Qianxi Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: