Description
TestReplicationPolicy failed on
- testChooseTargetWithMoreThanAvailableNodes()
- testChooseTargetWithStaleNodes()
- testChooseTargetWithHalfStaleNodes()
The root of cause of testChooseTargetWithMoreThanAvailableNodes failing is the following:
In BlockPlacementPolicyDefault#chooseTarget()
chooseRandom(numOfReplicas, NodeBase.ROOT, excludedNodes, blocksize, maxNodesPerRack, results); } catch (NotEnoughReplicasException e) { FSNamesystem.LOG.warn("Not able to place enough replicas, still in need of " + numOfReplicas);
However, numOfReplicas is passed into chooseRandom() as int (primitive type in java) by value. The updating operation for numOfReplicas in chooseRandom() will not change the value in chooseTarget().
The root cause for testChooseTargetWithStaleNodes() and testChooseTargetWithHalfStaleNodes() is the current BlockPlacementPolicyDefault#chooseTarget() doesn't check if a node is stale.
Attachments
Attachments
Issue Links
- relates to
-
HDFS-5001 Branch-1-Win TestAzureBlockPlacementPolicy and TestReplicationPolicyWithNodeGroup failed caused by 1) old APIs and 2) incorrect value of depthOfAllLeaves
- Resolved