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

Tsz Wo (Nicholas), SZE commented on HDFS-3456:
----------------------------------------------

> 2**53 milliseconds is thousands of years. ...

- Java double (IEEE 754 64-bit) has only 52 precision (not 53, one bit is for 
the sign).  So it should be 2**52.

- This is exactly the point that nextRandomLong is unnecessary.  I personally 
am very interested in the implementation of nextRandomLong or, more generally, 
this kind of computation problem.  However, I don't want to add a unless method 
to Hadoop and I believe such method would lead to more bugs than preventing 
bugs since people will use it unnecessarily instead of fixing the calculation.

The new patch looks much better but it is even better to simply check delay 
limit and then throw exception.  As you mentioned, setting delay to such large 
value does not make sense.

For the so called "backwards compatibility", do you mean that when there was a 
bug in the previous version, we should support the same bug in order to keep 
the same behavior?
                
> blockReportInterval is long value but when we take the random value it uses 
> getRandom().nextInt,it is causing frequently BR
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-3456
>                 URL: https://issues.apache.org/jira/browse/HDFS-3456
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node
>    Affects Versions: 2.0.0-alpha
>            Reporter: Brahma Reddy Battula
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>         Attachments: HDFS-3456.001.patch, HDFS-3456.002.patch, 
> HDFS-3456.003.patch, HDFS-3456.004.patch
>
>
> blockReportInterval is long value but when we take the random value it uses 
> getRandom().nextInt.
> Due to this, offerService can throw exception as long may get rotated to 
> negative value.
> So, block report may send very frequently.
> {code}
>       if (resetBlockReportTime) {
>         lastBlockReport = startTime - 
> DFSUtil.getRandom().nextInt((int)(dnConf.blockReportInterval));
>       resetBlockReportTime = false;
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to