[
https://issues.apache.org/jira/browse/HDFS-7647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Milan Desai updated HDFS-7647:
------------------------------
Attachment: HDFS-7647-3.patch
Thanks [~arpitagarwal] for the review, and sorry about the delay.
1. I returned the fields for {{storageIDs}} and {{storageTypes}} to store their
cached versions.
2. Introduced method {{invalidateCachedStorageInfos}} to invalidate the arrays
for {{storageIDs}} and {{storageTypes}}. It is called by {{sortLocatedBlocks}}
after the sorting.
3. Added unit test {{TestDatanodeManager.testSortLocatedBlocks}}.
4. I added a comment to {{getLocations()}} saying the returned array is not
expected to be modified, and if it is, caller must immediately invoke
{{invalidateCachedStorageInfos}} from (2)
Will open a separate Jira for making {{locs}} an immutable list.
> 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.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)