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

Anu Engineer commented on HDFS-12487:
-------------------------------------

[~liumihust] Welcome to Apache. Thanks for filing this.  Generally we attach a 
patch (diff file) of sources to a JIRA to indicate to Jenkins that it needs to 
pick up this change and build/test the changes you are proposing.

Here is the process to do that.

1. Get the Hadoop Code base --> "*git clone http;//github.....*"
2. make the changes in code -- in this case the if check that you want to add.
3. compile the code base --  I usually run '*mvn clean install -DskipTests=true 
-Dmaven.javadoc.skip=true -DskipShade*'
4. If the build works, please create a patch -- **git diff  > 
~/HDFS-12487.001.patch**  or *git diff  --no-prefix > ~/HDFS-12487.001.patch*
5. Then you can make sure that your patch works, the following commands will 
clean the git repo --
   *git reset --hard; git clean -f -d*"
6. Now we can test the patch -- from your hadoop directory please run 
'*./dev-support/bin/smart-apply-patch ~/HDFS-12487.001.patch*'
7. This will apply the patch locally which means that Jenkins will be able to 
apply it too.
8. I generally run one more step, I clean the directory again and I run 
"*/dev-support/bin/test-patch ~/HDFS-12487.001.patch*" This will flag 
checkstyle, findbugs issues that Jenkins would spot for you, so you can avoid a 
around of fixing and updating the patch. The report will contain file names 
which you need to open to find out what is the real issue.
9. Once all of this is done, you come to JIRA, click on More->Attach files 
10. Then submit patch, Jenkins will pick up your patch, apply to Hadoop trunk, 
run all tests and other tools and create a report. 
11. Then one of the contributors/comitters will give you coe review comments or 
help you to commit the patch.

I really appreciate you taking the effort to bring your patch to Apache. In 
case you want a better reference here is the link to the HowToContribute Hadoop 
Wiki.

https://wiki.apache.org/hadoop/HowToContribute



> 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
>             Fix For: 3.0.0
>
>   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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to