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

Arpit Agarwal commented on HDFS-7411:
-------------------------------------

Hi Andrew, thank you for the heads up.

Looks like the change to {{addStoredBlockUnderConstruction}} is not necessary. 
The function was updated by HDFS-2832 when we added the concept of datanode as 
a collection of storages. Looking at the pre-2832 code:

{code}
    block.addReplicaIfNotPresent(node, block, reportedState);
    if (reportedState == ReplicaState.FINALIZED && block.findDatanode(node) < 
0) {
      addStoredBlock(block, node, null, true);
    }
{code}

And in {{addStoredBlock}} we have:

{code}
...
    // add block to the datanode
    boolean added = node.addBlock(storageID, storedBlock);
{code}

I am not sure what was the original reason for not adding UC blocks to the 
DataNode/storage but if nothing is broken right now perhaps we should leave it 
as it is. One more side effect of this change is that the subsequent if block 
will never be taken as block.findDatanode will always return true.


> Refactor and improve decommissioning logic into DecommissionManager
> -------------------------------------------------------------------
>
>                 Key: HDFS-7411
>                 URL: https://issues.apache.org/jira/browse/HDFS-7411
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 2.5.1
>            Reporter: Andrew Wang
>            Assignee: Andrew Wang
>         Attachments: hdfs-7411.001.patch, hdfs-7411.002.patch, 
> hdfs-7411.003.patch, hdfs-7411.004.patch
>
>
> Would be nice to split out decommission logic from DatanodeManager to 
> DecommissionManager.



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

Reply via email to