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

Tanping Wang commented on HDFS-1650:
------------------------------------

1) It seems that number of datanodes in the test is actually 4 according to 
this int numDataNodes = 4; so it isn't very clear why the loop has to be run 3 
times only.

The number of datanodes in the test is 4.  And the number of block replication, 
dfs.replication is also set to be 4. As mentioned in the test comments, 
this test case creates a file with one block and replication of 4. It corrupts 
two of the blocks and removes one of the replicas. Expected behavior is that 
missing replica will be copied from one valid source.  Hence, the loop needs to 
run 3 times. 

2) Also, it'd great to have a named constant instead of a mere number 3 + 
comment on top of it: this will increase the readability of the code.
Apparently, this comment has also been addressed in the internal patch review 
by Boris.  and the feedback to this comment by Suresh was

"This number is specific to local logic of the test and not a reusable 
constant. Test is trying to pick 3 replicas - deletes 1 and corrupts 2 and 
hence the number 3."




> Fix unit test case: TestReplication
> -----------------------------------
>
>                 Key: HDFS-1650
>                 URL: https://issues.apache.org/jira/browse/HDFS-1650
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: Federation Branch
>            Reporter: Tanping Wang
>            Assignee: Tanping Wang
>            Priority: Minor
>             Fix For: Federation Branch
>
>         Attachments: HDFS1650.patch
>
>
> TestReplication fails due to null pointer exception. When corrupting/deleting 
> blocks in TestReplication#testPendingReplicationRetry() the loop should run 
> for 3 datanodes.
> Instead it runs 6 times, resulting in null blockFile returned. Changing the 
> loop to run 3 times.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to