You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Lei (Eddy) Xu (JIRA)" <ji...@apache.org> on 2015/03/02 19:40:04 UTC

[jira] [Updated] (HADOOP-11626) DFSInputStream should only update ReadStatistics when the read is success.

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

Lei (Eddy) Xu updated HADOOP-11626:
-----------------------------------
    Attachment: HADOOP-11626.001.patch

[~ozawa] and [~cmccabe] Thanks for reviewing this. You are correct. Now I realized that the read stats are for the actual read occurred. I updated the patch to add comments to {{ReadStatistics}} to make this clear. 

Also I added {{LOG.info}} for the error. 

bq. However, one thing that concerns me here is that nread can be -1, in the case where the block reader hit EOF. We should not be adding -1 to the read statistics.

[~cmccabe] This case has already been handled in {{DFSInputStream#updateReadStatistics}}. 



> DFSInputStream should only update ReadStatistics when the read is success.
> --------------------------------------------------------------------------
>
>                 Key: HADOOP-11626
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11626
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.6.0
>            Reporter: Lei (Eddy) Xu
>            Assignee: Lei (Eddy) Xu
>            Priority: Trivial
>         Attachments: HADOOP-11626.000.patch, HADOOP-11626.001.patch
>
>
> In {{DFSOutputStream#actualGetFromOneDataNode()}}, it updates the {{ReadStatistics}} even the read is failed:
> {code}
>         int nread = reader.readAll(buf, offset, len);
>         updateReadStatistics(readStatistics, nread, reader);
>         if (nread != len) {
>           throw new IOException("truncated return from reader.read(): " +
>                                 "excpected " + len + ", got " + nread);
>         }
> {code}
> It should only record success read, i.e., after throwing {{IOE}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)