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

SnapshotFileCache will always refresh the file cache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.1, 0.98.23, 2.0.0
    • 1.4.0, 2.0.0
    • snapshots
    • None
    • Reviewed

    Description

      In SnapshotFileCache#refreshCache, the hasChanges will be judged as:

          try {
            FileStatus dirStatus = fs.getFileStatus(snapshotDir);
            lastTimestamp = dirStatus.getModificationTime();
            hasChanges |= (lastTimestamp >= lastModifiedTime); // >= will make hasChanges always be true
      

      The (lastTimestamp >= lastModifiedTime) will make hasChanges always be true because lastTimestamp will be updated as:

      this.lastModifiedTime = lastTimestamp;
      

      So, SnapshotFileCache will always refresh the file cache.

      Attachments

        1. HBASE-17330-v1.patch
          2 kB
          Jianwei Cui
        2. HBASE-17330-v2.patch
          3 kB
          Jianwei Cui

        Activity

          People

            cuijianwei Jianwei Cui
            cuijianwei Jianwei Cui
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: