[
https://issues.apache.org/jira/browse/HDFS-12487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174947#comment-16174947
]
Anu Engineer commented on HDFS-12487:
-------------------------------------
[~liumihust] Thank you for the fix. Once Jenkins runs it gives us some
feedback. In this patch, everything looks good except for a small checkstyle
issue.
https://builds.apache.org/job/PreCommit-HDFS-Build/21268/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs.txt
Please click on the link above ( copied from the Jenkins report above)
Generally, I would have said I will fix that issue while committing, but part
of the reason we are doing this JIRA is to get you familiar with how Apache
works, so you can bring in all the cool stuff you have done already.
Also when we update the patches we leave the older version of the code in
place. So when you fix this checkStyle issues, please create a new file
{{HDFS-12487.003.patch}} and attach it. You don't need to remove the {{.002}
patch Jenkins will automatically pick up the latest version.
> FsDatasetSpi.isValidBlock() lacks null pointer check inside and neither do
> the callers
> --------------------------------------------------------------------------------------
>
> Key: HDFS-12487
> URL: https://issues.apache.org/jira/browse/HDFS-12487
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: balancer & mover, diskbalancer
> Affects Versions: 3.0.0
> Environment: CentOS 6.8 x64
> CPU:4 core
> Memory:16GB
> Hadoop: Release 3.0.0-alpha4
> Reporter: liumi
> Assignee: liumi
> Fix For: 3.1.0
>
> Attachments: HDFS-12487.002.patch
>
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> BlockIteratorImpl.nextBlock() will look for the blocks in the source volume,
> if there are no blocks any more, it will return null up to
> DiskBalancer.getBlockToCopy(). However, the DiskBalancer.getBlockToCopy()
> will check whether it's a valid block.
> When I look into the FsDatasetSpi.isValidBlock(), I find that it doesn't
> check the null pointer! In fact, we firstly need to check whether it's null
> or not, or exception will occur.
> This bug is hard to find, because the DiskBalancer hardly copy all the data
> of one volume to others. Even if some times we may copy all the data of one
> volume to other volumes, when the bug occurs, the copy process has already
> done.
> However, when we try to copy all the data of two or more volumes to other
> volumes in more than one step, the thread will be shut down, which is caused
> by the bug above.
> The bug can fixed by two ways:
> 1)Before the call of FsDatasetSpi.isValidBlock(), we check the null pointer
> 2)Check the null pointer inside the implementation of
> FsDatasetSpi.isValidBlock()
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]