You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Jianwei Cui (JIRA)" <ji...@apache.org> on 2016/12/17 10:01:13 UTC

[jira] [Created] (HBASE-17330) SnapshotFileCache will always refresh the file cache

Jianwei Cui created HBASE-17330:
-----------------------------------

             Summary: SnapshotFileCache will always refresh the file cache
                 Key: HBASE-17330
                 URL: https://issues.apache.org/jira/browse/HBASE-17330
             Project: HBase
          Issue Type: Bug
          Components: snapshots
    Affects Versions: 0.98.23, 2.0.0, 1.3.1
            Reporter: Jianwei Cui
            Priority: Minor


In {{SnapshotFileCache#refreshCache}}, the {{hasChanges}} will be judged as:
{code}
    try {
      FileStatus dirStatus = fs.getFileStatus(snapshotDir);
      lastTimestamp = dirStatus.getModificationTime();
      hasChanges |= (lastTimestamp >= lastModifiedTime); // >= will make hasChanges always be true
{code}
The  {{(lastTimestamp >= lastModifiedTime)}} will make {{hasChanges}} always be true because {{lastTimestamp}} will be updated as:
{code}
this.lastModifiedTime = lastTimestamp;
{code}
So, SnapshotFileCache will always refresh the file cache.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)