hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jing Zhao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-9748) When addExpectedReplicasToPending is called twice, pendingReplications should avoid duplication
Date Wed, 03 Feb 2016 18:35:39 GMT

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

Jing Zhao commented on HDFS-9748:
---------------------------------

Thanks for the fix, Walter. The patch looks good to me. The test failures look suspicious.
Just trigger the Jenkins again.

> 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
>         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)

Mime
View raw message