hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yi Liu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-6786) Fix potential issue of cache refresh interval
Date Wed, 30 Jul 2014 10:51:38 GMT
Yi Liu created HDFS-6786:

             Summary: Fix potential issue of cache refresh interval
                 Key: HDFS-6786
                 URL: https://issues.apache.org/jira/browse/HDFS-6786
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: caching
    Affects Versions: 3.0.0
            Reporter: Yi Liu
            Assignee: Yi Liu

In {{CacheReplicationMonitor}}, following code is try to check whether needs to rescan every
interval ms, if rescan takes n ms, then subtract n ms for the interval. But if the delta <=0,
it breaks and start rescan, there will be potential issue: if user set the interval to a small
value or rescan finished after a while exceeding the interval, then rescan will happen in
loop. Furthermore, {{delta <= 0}} trigger the rescan should not be the intention, since
if needs rescan, {{needsRescan}} will be set.
         while (true) {
            if (shutdown) {
              LOG.info("Shutting down CacheReplicationMonitor");
            if (needsRescan) {
              LOG.info("Rescanning because of pending operations");
            long delta = (startTimeMs + intervalMs) - curTimeMs;
            if (delta <= 0) {
              LOG.info("Rescanning after " + (curTimeMs - startTimeMs) +
                  " milliseconds");
            doRescan.await(delta, TimeUnit.MILLISECONDS);
            curTimeMs = Time.monotonicNow();

This message was sent by Atlassian JIRA

View raw message