[
https://issues.apache.org/jira/browse/HDFS-7647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14310123#comment-14310123
]
Milan Desai commented on HDFS-7647:
-----------------------------------
Some of the tests were failing because the .equals() and .hashCode() method in
DatanodeInfoWithStorage also checked for storage equality, and tests like
TestShortCircuitCache relied on the ability to identify DatanodeInfos in a map
using a DatanodeInfoWithStorage object. The fix was to remove the equals() and
hashCode() overrides so that they rely on the super.
TestDecomission.testDecomissionWithOpenfile is failing because the test is
waiting for the DatanodeInfoWithStorage object to become decommissioned, but it
won't ever be decommissioned because it is not the same reference as the
DatanodeInfo in the datanode map. This poses a larger problem in that the
client may expect changes to the datanode state to be reflected in the output
of LocatedBlock.getLocations(), but they won't be because we create a new
DatanodeInfoWithStorage object during construction and return it in
getLocations().
Instead of having DatanodeInfoWithStorage be a subclass of DatanodeInfo, we
could make it be a wrapper for DatanodeInfo, StorageID, and StorageType. Then
to make NetworkTopology.sortByDistance work, we would have to make it implement
Node and/or DatanodeInfo.
> DatanodeManager.sortLocatedBlocks() sorts DatanodeInfos but not StorageIDs
> --------------------------------------------------------------------------
>
> Key: HDFS-7647
> URL: https://issues.apache.org/jira/browse/HDFS-7647
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 2.6.0
> Reporter: Milan Desai
> Assignee: Milan Desai
> Attachments: HDFS-7647-2.patch, HDFS-7647-3.patch, HDFS-7647-4.patch,
> HDFS-7647.patch
>
>
> DatanodeManager.sortLocatedBlocks() sorts the array of DatanodeInfos inside
> each LocatedBlock, but does not touch the array of StorageIDs and
> StorageTypes. As a result, the DatanodeInfos and StorageIDs/StorageTypes are
> mismatched. The method is called by FSNamesystem.getBlockLocations(), so the
> client will not know which StorageID/Type corresponds to which DatanodeInfo.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)