You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Arpit Agarwal (JIRA)" <ji...@apache.org> on 2013/12/03 17:34:35 UTC

[jira] [Resolved] (HDFS-5484) StorageType and State in DatanodeStorageInfo in NameNode is not accurate

     [ https://issues.apache.org/jira/browse/HDFS-5484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arpit Agarwal resolved HDFS-5484.
---------------------------------

       Resolution: Fixed
    Fix Version/s: Heterogeneous Storage (HDFS-2832)
     Hadoop Flags: Reviewed

+1 for the updated patch. I committed it to branch HDFS-2832.

I agree that the test for this will take some work but we will need it once we start exposing Storage Types to applications. I will make a note in the test plan.

Thanks Eric!

> StorageType and State in DatanodeStorageInfo in NameNode is not accurate
> ------------------------------------------------------------------------
>
>                 Key: HDFS-5484
>                 URL: https://issues.apache.org/jira/browse/HDFS-5484
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode
>    Affects Versions: Heterogeneous Storage (HDFS-2832)
>            Reporter: Eric Sirianni
>             Fix For: Heterogeneous Storage (HDFS-2832)
>
>         Attachments: HDFS-5484-HDFS-2832--2.patch, HDFS-5484-HDFS-2832.patch
>
>
> The fields in DatanodeStorageInfo are updated from two distinct paths:
> # block reports
> # storage reports (via heartbeats)
> The {{state}} and {{storageType}} fields are updated via the Block Report.  However, as seen in the code blow, these fields are populated from a "dummy" {{DatanodeStorage}} object constructed in the DataNode:
> {code}
> BPServiceActor.blockReport() {
> //...
>         // Dummy DatanodeStorage object just for sending the block report.
>         DatanodeStorage dnStorage = new DatanodeStorage(storageID);
> //...
> }
> {code}
> The net effect is that the {{state}} and {{storageType}} fields are always the default of {{NORMAL}} and {{DISK}} in the NameNode.
> The recommended fix is to change {{FsDatasetSpi.getBlockReports()}} from:
> {code}
> public Map<String, BlockListAsLongs> getBlockReports(String bpid);
> {code}
> to:
> {code}
> public Map<DatanodeStorage, BlockListAsLongs> getBlockReports(String bpid);
> {code}
> thereby allowing {{BPServiceActor}} to send the "real" {{DatanodeStorage}} object with the block report.



--
This message was sent by Atlassian JIRA
(v6.1#6144)