[
https://issues.apache.org/jira/browse/HDFS-9036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14741949#comment-14741949
]
Vinayakumar B commented on HDFS-9036:
-------------------------------------
Thanks [~andreina] for reporting the issue.
1. Following change is unnecessary. its already in 'else' part since 'if' block
will return.
{code}+ } else {
+ if (!fallbackToLocalRack) {
+ return null;
+ }
+ // try a node on local rack
+ return chooseLocalRack(localMachine, excludedNodes, blocksize,
+ maxNodesPerRack, results, avoidStaleNodes, storageTypes);
}
-
- if (!fallbackToLocalRack) {
- return null;
- }
- // try a node on local rack
- return chooseLocalRack(localMachine, excludedNodes,
- blocksize, maxNodesPerRack, results, avoidStaleNodes,
storageTypes);{code}
Other changes are fine.
+1 once addressed above comment.
Hi [~szetszwo], Do you have any suggestions here? Thanks.
> In BlockPlacementPolicyWithNodeGroup#chooseLocalStorage , random node is
> selected eventhough fallbackToLocalRack is true.
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: HDFS-9036
> URL: https://issues.apache.org/jira/browse/HDFS-9036
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: J.Andreina
> Assignee: J.Andreina
> Attachments: HDFS-9036.1.patch
>
>
> For example in below clusterMap
> Writer = "/d2/r4/n8" which does not have local node.
> Available nodes rack = {"/d2/r4/n7","/d1/r1/n1","/d1/r2/n3","/d2/r3/n6"}
> Current hierarchy in choosing node for first local storage replica is
> 1. Choose local machine (Not available)
> 2. Choose Local node group machine (Not available)
> 3. choose random
> *But instead of choosing random , should choose localrack node first(if
> fallbackToLocalRack is true, in example it is "/d2/r4/n7" ) else should go
> for radom node*
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)