Author: cutting Date: Wed Jun 20 14:58:17 2007 New Revision: 549268 URL: http://svn.apache.org/viewvc?view=rev&rev=549268 Log: HADOOP-1501. Better randomize sending of block reports to namenode. Contributed by Dhruba.
Modified: lucene/hadoop/trunk/CHANGES.txt lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java Modified: lucene/hadoop/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=549268&r1=549267&r2=549268 ============================================================================== --- lucene/hadoop/trunk/CHANGES.txt (original) +++ lucene/hadoop/trunk/CHANGES.txt Wed Jun 20 14:58:17 2007 @@ -223,6 +223,9 @@ 67. HADOOP-1455. Permit specification of arbitrary job options on pipes command line. (Devaraj Das via cutting) + 68. HADOOP-1501. Better randomize sending of block reports to + namenode, so reduce load spikes. (Dhruba Borthakur via cutting) + Release 0.13.0 - 2007-06-08 Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java?view=diff&rev=549268&r1=549267&r2=549268 ============================================================================== --- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java (original) +++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java Wed Jun 20 14:58:17 2007 @@ -483,7 +483,15 @@ // DatanodeCommand cmd = namenode.blockReport(dnRegistration, data.getBlockReport()); - lastBlockReport = now; + // + // If we have sent the first block report, then wait a random + // time before we start the periodic block reports. + // + if (lastBlockReport == 0) { + lastBlockReport = now - new Random().nextInt((int)(blockReportInterval)); + } else { + lastBlockReport = now; + } processCommand(cmd); }