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

Store doReconstructionLog will fail if oldlogfile.log is empty and won't load region

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.3
    • Fix Version/s: 0.20.4, 0.90.0
    • Component/s: regionserver
    • Labels:
      None
    • Environment:

      Any

    • Hadoop Flags:
      Reviewed

      Description

      doReconstructionLog doesn't handle empty files correctly:

          FileStatus stat = this.fs.getFileStatus(reconstructionLog);
          if (stat.getLen() <= 0) {
            LOG.warn("Passed reconstruction log " + reconstructionLog +
              " is zero-length. Deleting existing file");
             fs.delete(reconstructionLog, false);
            return -1;
          }
      

      Notice it actually compares the length of the array instead of the file length.

      It should call getLen() and delete the file afterwards

         FileStatus stat = this.fs.getFileStatus(reconstructionLog);
          if (stat.getLen() <= 0) {
            LOG.warn("Passed reconstruction log " + reconstructionLog +
              " is zero-length. Deleting existing file");
             fs.delete(reconstructionLog, false);
            return -1;
          }
      

      Also. This is a situation that shouldn't happen as an empty oldlogfile.log should be deleted when HMaster does the split in HLog.splitLog().
      I couldn't figure what would make it leave it there as I also see in the logs that other empty logs are deleted. This might expose a thornier situation.

        Attachments

        1. HBASE-2358.patch
          1 kB
          Cosmin Lehene

        Issue Links

          Activity

            People

            • Assignee:
              clehene Cosmin Lehene
              Reporter:
              clehene Cosmin Lehene

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Issue deployment