Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
In branch-1-win, when AzureBlockPlacementPolicy (which extends the BlockPlacementPolicyDefault) is used, if the client increases the number of replicas (e.g., from 3 to 10), AzureBlockPlacementPolicy#chooseTarget will return only 1 Datanode each time. Thus in FSNameSystem#computeReplicationWorkForBlock, it is possible that the replication monitor may choose a datanode that has been chosen as target but still in the pendingReplications (because computeReplicationWorkForBlock does not check the pending replication before doing the chooseTarget).
To avoid this "hit-the-same-datanode" scenario, we modify the AzureBlockPlacementPolicy#chooseTarget to make it return multiple DN.