[
https://issues.apache.org/jira/browse/HDFS-3456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13282887#comment-13282887
]
Tsz Wo (Nicholas), SZE commented on HDFS-3456:
----------------------------------------------
I think the patch works only for some special cases. It is incorrect for the
following cases:
# Low bits values should depend on high bits; try
{code}
max = (1L << 32) + (1L << 16)
{code}
# High bits should range from 0 to highMax INCLUSIVELY in some cases; try
{code}
max = (1L << 32) - 1
{code}
# Two 31-bit int's cannot handle a 63-bit long; try
{code}
max = Long.MAX_VALUE
{code}
> However, given that we accept a long, ...
Correct me if I am wrong: I think we have not specified the type (int or long)
or the max value for this conf property in the documentation. The code somehow
reads it as a long.
> Alternately, we could throw an exception and let the user know that his input
> is being ignored.
It is better to throw an exception if blockReportInterval > Integer.MAX_VALUE
(or some other large values.)
> 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
>
>
> 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