[
https://issues.apache.org/jira/browse/HDFS-8688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14630671#comment-14630671
]
Ming Ma commented on HDFS-8688:
-------------------------------
Thanks [~walter.k.su]. Your explanation makes sense. But I still want to
clarify if there is any behavior change. {{isNeededReplication}} can be called
by {{addStoredBlock}} with {{numCurrentReplica}} which isn't {{liveReplicas}}
as it includes pending replications as well. So you can have a scenario where
you decommission all replica nodes and you end up with 0 liveReplicas and
{{numCurrentReplica}} is the same as expected replication. So in the case all
replicas are in decommission_inprogress state, {{blockHasEnoughRacks}} might
still be called. If so, {{blockHasEnoughRacks}} currently returns false as it
couldn't find any live replica; but with the patch, it returns true.
There are several other places that call {{blockHasEnoughRacks}} directly only
if there is no pending replications for that block. Maybe we can do the same
for {{addStoredBlock}} case in addition to the current patch. In that way, we
make sure {{blockHasEnoughRacks}} will be called only when there is enough
{{liveReplicas}}.
Alternatively we can just remove the {{this.shouldCheckForEnoughRacks}} check
to keep {{blockHasEnoughRacks}}'s behavior. Thought?
> 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)