[
https://issues.apache.org/jira/browse/HDFS-9748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Walter Su updated HDFS-9748:
----------------------------
Description:
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}}.
> 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
> Reporter: Walter Su
> Assignee: Walter Su
> Priority: Minor
>
> 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)