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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.20.3
    • 0.20.4, 0.90.0
    • regionserver
    • None
    • Any

    • 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

              clehene Cosmin Lehene
              clehene Cosmin Lehene
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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