[
https://issues.apache.org/jira/browse/HDFS-8688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14630494#comment-14630494
]
Walter Su commented on HDFS-8688:
---------------------------------
if live nodes less than expected, we don't call {{blockHasEnoughRacks}},
especially live noes ==0 (if a block has no nodes, it must has no racks)
For example:
{code}
boolean isNeededReplication(BlockInfo storedBlock, int expected,
int current) {
return current < expected || !blockHasEnoughRacks(storedBlock, expected);
}
{code}
The logic of the original code is correct. The patch doesn't change the logic.
>..All blocks' replicas are corrupted.
At first, it won't go into {{blockHasEnoughRacks}}.
>...After this patch blockHasEnoughRacks will return true.
Assume it doesgo into {{blockHasEnoughRacks}}. It returns false after this
patch. The patch doesn't change the logic.
-----------
bq. My main question is which component actually uses isSingleSwitch API. Steve
Loughran added this in HADOOP-7777 and might have some input.
No component of hadoop uses it. I don't know if there is other apache project
which depends on hadoop-common use it. But
{code}
<property>
<name>net.topology.node.switch.mapping.impl</name>
<value>org.apache.hadoop.net.ScriptBasedMapping</value>
</property>
{code}
And also {{NetworkTopology}}, {{BlockPlacementPolicy}} can be custom designed
by user. I think the API is useless to user also. But since it is already
exposed to user, maybe hard to remove it.
> replace shouldCheckForEnoughRacks with hasClusterEverBeenMultiRack
> ------------------------------------------------------------------
>
> Key: HDFS-8688
> URL: https://issues.apache.org/jira/browse/HDFS-8688
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Walter Su
> Assignee: Walter Su
> Attachments: HDFS-8688.01.patch, HDFS-8688.02.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)