[ https://issues.apache.org/jira/browse/HDFS-9922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15189448#comment-15189448 ]
Ming Ma commented on HDFS-9922: ------------------------------- Thanks [~ctrezzo]. The patch makes sense. * Based on how it is {{verifyBlockPlacement}} is used, it seems {{numOfReplicas}} means replication factor. Maybe we should modify the parameter name {{numOfReplicas}} to {{replicationFactor}} at the {{BlockPlacementPolicy}} level? * There is another case. Say the replication factor is 2, the block has 3 replications temporarily due to over replication such as recommission. In such case, {{numberOfReplicas}} is 2 and {{upgradeDomains.size()}} is 3. Wonder if we can change the check from {{numberOfReplicas == upgradeDomains.size()}} to {{numberOfReplicas <= upgradeDomains.size()}}. * The new test case is good. But it passes even without the fix. So it will be good if we can improve the test. > Upgrade Domain placement policy status marks a good block in violation when > there are decommissioned nodes > ---------------------------------------------------------------------------------------------------------- > > Key: HDFS-9922 > URL: https://issues.apache.org/jira/browse/HDFS-9922 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Chris Trezzo > Assignee: Chris Trezzo > Priority: Minor > Attachments: HDFS-9922-trunk-v1.patch > > > When there are replicas of a block on a decommissioned node, > BlockPlacementStatusWithUpgradeDomain#isUpgradeDomainPolicySatisfied returns > false when it should return true. This is because numberOfReplicas is the > number of in-service replicas for the block and upgradeDomains.size() is the > number of upgrade domains across all replicas of the block. Specifically, we > hit this scenario when numberOfReplicas is equal to upgradeDomainFactor and > upgradeDomains.size() is greater than numberOfReplicas. > {code} > private boolean isUpgradeDomainPolicySatisfied() { > if (numberOfReplicas <= upgradeDomainFactor) { > return (numberOfReplicas == upgradeDomains.size()); > } else { > return upgradeDomains.size() >= upgradeDomainFactor; > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)