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

SnapshotHFileCleaner makes the wrong check for lastModified time thus causing too many cache refreshes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 0.94.19
    • None
    • None
    • None

    Description

      The SnapshotHFileCleaner calls the SnapshotFileCache if a particular HFile in question is part of a snapshot.
      If the HFile is not in the cache, we then refresh the cache and check again.

      But the cache refresh checks to see if anything has been modified since the last cache refresh but this logic is incorrect in certain scenarios.

      The last modified time is done via this operation:

      this.lastModifiedTime = Math.min(dirStatus.getModificationTime(),
                                           tempStatus.getModificationTime());
      

      and the check to see if the snapshot directories have been modified:

      // if the snapshot directory wasn't modified since we last check, we are done
          if (dirStatus.getModificationTime() <= lastModifiedTime &&
              tempStatus.getModificationTime() <= lastModifiedTime) {
            return;
          }
      

      Suppose the following happens:
      dirStatus modified 6-1-2014
      tempStatus modified 6-2-2014

      lastModifiedTime = 6-1-2014

      provided these two directories don't get modified again all subsequent checks wont exit early, like they should.

      In our cluster, this was a huge performance hit. The cleaner chain fell behind, thus almost filling up dfs and our namenode heap.

      Its a simple fix, instead of Math.min we use Math.max for the lastModified, I believe that will be correct.

      I'll apply a patch for you guys.

      Attachments

        1. 11322.94.txt
          2 kB
          Lars Hofhansl
        2. HBASE-11322.patch
          1 kB
          churro morales

        Issue Links

          Activity

            People

              Unassigned Unassigned
              churromorales churro morales
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: