[ 
https://issues.apache.org/jira/browse/HDFS-9748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jing Zhao updated HDFS-9748:
----------------------------
       Resolution: Fixed
     Hadoop Flags: Reviewed
    Fix Version/s: 2.8.0
           Status: Resolved  (was: Patch Available)

I've committed this to trunk, branch-2 and branch-2.8. Thanks for the fix, 
Walter!

> When addExpectedReplicasToPending is called twice, pendingReplications should 
> avoid duplication
> -----------------------------------------------------------------------------------------------
>
>                 Key: HDFS-9748
>                 URL: https://issues.apache.org/jira/browse/HDFS-9748
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.8.0
>            Reporter: Walter Su
>            Assignee: Walter Su
>            Priority: Minor
>             Fix For: 2.8.0
>
>         Attachments: HDFS-9748.01.patch
>
>
> 1. When completeFile() is called, addExpectedReplicasToPending() will be 
> called (HDFS-8999).
> 2. When first replica is reported, addExpectedReplicasToPending() will be 
> called the second time.
> {code}
> //BlockManager.addStoredBlock(..)
>     if(storedBlock.getBlockUCState() == BlockUCState.COMMITTED &&
>         hasMinStorage(storedBlock, numLiveReplicas)) {
>       addExpectedReplicasToPending(storedBlock, bc);
>       completeBlock(storedBlock, false);
>     } else if (storedBlock.isComplete() && result == AddBlockResult.ADDED) {
> {code}
> But,
> {code}
> //PendingReplicationBlocks.java
>     void incrementReplicas(DatanodeDescriptor... newTargets) {
>       if (newTargets != null) {
>         Collections.addAll(targets, newTargets);
>       }
>     }
> {code}
> targets is ArrayList, the above code simply add all {{newTargets}} to 
> {{targets}}.



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

Reply via email to