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] [Commented] (HDFS-6786) Fix potential issue of cache refresh interval
Date Thu, 31 Jul 2014 07:32:39 GMT

    [ https://issues.apache.org/jira/browse/HDFS-6786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14080606#comment-14080606
] 

Yi Liu commented on HDFS-6786:
------------------------------

How about set the interval to a large value, 5 minutes or 15 minutes as you said. And we define
a minimum interval value (e.g. 30s) to protect against user misconfigure and affect NN's performance
but without warning. 

> 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: 2.4.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.
> {code}
>          while (true) {
>             if (shutdown) {
>               LOG.info("Shutting down CacheReplicationMonitor");
>               return;
>             }
>             if (needsRescan) {
>               LOG.info("Rescanning because of pending operations");
>               break;
>             }
>             long delta = (startTimeMs + intervalMs) - curTimeMs;
>             if (delta <= 0) {
>               LOG.info("Rescanning after " + (curTimeMs - startTimeMs) +
>                   " milliseconds");
>               break;
>             }
>             doRescan.await(delta, TimeUnit.MILLISECONDS);
>             curTimeMs = Time.monotonicNow();
>           }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message