hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Nauroth (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-8681) BlockScanner is incorrectly disabled by default
Date Sat, 27 Jun 2015 05:39:05 GMT

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

Chris Nauroth commented on HDFS-8681:
-------------------------------------

The old logic, pre-HDFS-7430, was as Arpit described, disabling only for a negative value.

{code}
  private synchronized void initDataBlockScanner(Configuration conf) {
    if (blockScanner != null) {
      return;
    }
    String reason = null;
    assert data != null;
    if (conf.getInt(DFS_DATANODE_SCAN_PERIOD_HOURS_KEY,
                    DFS_DATANODE_SCAN_PERIOD_HOURS_DEFAULT) < 0) {
      reason = "verification is turned off by configuration";
    } else if ("SimulatedFSDataset".equals(data.getClass().getSimpleName())) {
      reason = "verifcation is not supported by SimulatedFSDataset";
    } 
    if (reason == null) {
      blockScanner = new DataBlockScanner(this, data, conf);
      blockScanner.start();
    } else {
      LOG.info("Periodic Block Verification scan disabled because " + reason);
    }
  }
{code}

Backwards-compatibility requires that we restore that logic.  Otherwise, if someone had a
hdfs-site.xml file that set {{dfs.datanode.scan.period.hours}} to 0 explicitly, then it would
stop working.

> BlockScanner is incorrectly disabled by default
> -----------------------------------------------
>
>                 Key: HDFS-8681
>                 URL: https://issues.apache.org/jira/browse/HDFS-8681
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.7.0
>            Reporter: Andrew Wang
>            Assignee: Colin Patrick McCabe
>            Priority: Blocker
>
> This code is used to check whether the block scanner is enabled:
> {noformat}
>   public boolean isEnabled() {
>     return (conf.scanPeriodMs) > 0 && (conf.targetBytesPerSec > 0);
>   }
> {noformat}
> Unfortunately, when this was introduced, we did not change the default scan period's
value of 0, which means by default the BlockScanner is disabled.



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

Mime
View raw message