[ 
https://issues.apache.org/jira/browse/HDFS-10626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15383261#comment-15383261
 ] 

Yongjun Zhang commented on HDFS-10626:
--------------------------------------

HI [~linyiqun],

Thanks for the new rev.

What about changing:
{code}
      LOG.warn("Reporting bad {} on {}", block, volume.getBasePath());
      try {
        scanner.datanode.reportBadBlocks(block, volume);
      } catch (IOException ie) {
        // This is bad, but not bad enough to shut down the scanner.
        LOG.warn("Cannot report bad block {}, {}, "
            + "the exception for the bad block: {}", block, ie, e);
      }
{code}

to

{code}
      LOG.warn("Reporting bad " + block + " with volume "
          + volume.getBasePath(), e);
      try {
        scanner.datanode.reportBadBlocks(block, volume);
      } catch (IOException ie) {
        // This is bad, but not bad enough to shut down the scanner.
        LOG.warn("Cannot report bad block " + block, ie);
      }
{code}

Notice that I changed to use a different logger api. Since this is exception 
handling, the cost increase may not be a big problem.

Thanks.


> VolumeScanner prints incorrect IOException in reportBadBlocks operation
> -----------------------------------------------------------------------
>
>                 Key: HDFS-10626
>                 URL: https://issues.apache.org/jira/browse/HDFS-10626
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>            Priority: Minor
>              Labels: supportability
>         Attachments: HDFS-10626.001.patch, HDFS-10626.002.patch, 
> HDFS-10626.003.patch
>
>
> VolumeScanner throws incorrect IOException in {{datanode.reportBadBlocks}}. 
> The related codes:
> {code}
>     public void handle(ExtendedBlock block, IOException e) {
>       FsVolumeSpi volume = scanner.volume;
>       ...
>       try {
>         scanner.datanode.reportBadBlocks(block, volume);
>       } catch (IOException ie) {
>         // This is bad, but not bad enough to shut down the scanner.
>         LOG.warn("Cannot report bad " + block.getBlockId(), e);
>       }
>     }
> {code}
> The IOException that printed in the log should be {{ie}} rather than {{e}} 
> which was passed in method {{handle(ExtendedBlock block, IOException e)}}.
> It will be a important info that can help us to know why datanode 
> reporBadBlocks failed.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to