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-9401) Fix the findbug in o.a.h.h.server.datanode.BlockRecoveryWorker$RecoveryTaskContiguous.recover()
Date Mon, 09 Nov 2015 17:58:11 GMT

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

Chris Nauroth commented on HDFS-9401:
-------------------------------------

It appears this was introduced by HDFS-9255.  Prior to HDFS-9255, the relevant code was in
{{DataNode#recoverBlock}}:

{code}
  /** Recover a block */
  private void recoverBlock(RecoveringBlock rBlock) throws IOException {
    ExtendedBlock block = rBlock.getBlock();
    String blookPoolId = block.getBlockPoolId();
    DatanodeID[] datanodeids = rBlock.getLocations();
    List<BlockRecord> syncList = new ArrayList<BlockRecord>(datanodeids.length);
    int errorCount = 0;

    //check generation stamps
    for(DatanodeID id : datanodeids) {
      try {
        BPOfferService bpos = blockPoolManager.get(blookPoolId);
        DatanodeRegistration bpReg = bpos.bpRegistration;
        InterDatanodeProtocol datanode = bpReg.equals(id)?
            this: DataNode.createInterDataNodeProtocolProxy(id, getConf(),
                dnConf.socketTimeout, dnConf.connectToDnViaHostname);
{code}

There is a Findbugs suppression defined on that method:

{code}
     <!-- Don't complain about recoverBlock equality check -->
     <Match>
       <Class name="org.apache.hadoop.hdfs.server.datanode.DataNode" />
       <Method name="recoverBlock" />
       <Bug pattern="EC_UNRELATED_TYPES" />
     </Match>
{code}

HDFS-3837 describes the rationale for that suppression.

The HDFS-9255 refactoring moved this logic to {{BlockRecoveryWorker}}, but it did not update
the Findbugs suppression.

[~walter.k.su], would you please help review and fix this?  Thanks!

> Fix the findbug in o.a.h.h.server.datanode.BlockRecoveryWorker$RecoveryTaskContiguous.recover()
> -----------------------------------------------------------------------------------------------
>
>                 Key: HDFS-9401
>                 URL: https://issues.apache.org/jira/browse/HDFS-9401
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Brahma Reddy Battula
>            Assignee: Brahma Reddy Battula
>         Attachments: HDFS-9401.patch
>
>
> Noticed following findbug in HDFS-9400 
> {noformat}
> Call to org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration.equals(org.apache.hadoop.hdfs.protocol.DatanodeInfo)
in org.apache.hadoop.hdfs.server.datanode.BlockRecoveryWorker$RecoveryTaskContiguous.recover()
> Bug type EC_UNRELATED_TYPES (click for details) 
> In class org.apache.hadoop.hdfs.server.datanode.BlockRecoveryWorker$RecoveryTaskContiguous
> In method org.apache.hadoop.hdfs.server.datanode.BlockRecoveryWorker$RecoveryTaskContiguous.recover()
> Actual type org.apache.hadoop.hdfs.protocol.DatanodeInfo
> Expected org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration
> Value loaded from id
> Value loaded from bpReg
> org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration.equals(Object) used to determine
equality
> At BlockRecoveryWorker.java:[line 116]
> {noformat}
> https://builds.apache.org/job/PreCommit-HDFS-Build/13433/artifact/patchprocess/branch-findbugs-hadoop-hdfs-project_hadoop-hdfs-warnings.html



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

Mime
View raw message