Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.8.0
-
None
-
None
-
Reviewed
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.
//BlockManager.addStoredBlock(..) if(storedBlock.getBlockUCState() == BlockUCState.COMMITTED && hasMinStorage(storedBlock, numLiveReplicas)) { addExpectedReplicasToPending(storedBlock, bc); completeBlock(storedBlock, false); } else if (storedBlock.isComplete() && result == AddBlockResult.ADDED) {
But,
//PendingReplicationBlocks.java void incrementReplicas(DatanodeDescriptor... newTargets) { if (newTargets != null) { Collections.addAll(targets, newTargets); } }
targets is ArrayList, the above code simply add all newTargets to targets.