Browse Source

HADOOP-4971. A long (unexpected) delay at datanodes could make subsequent\nblock reports from many datanode at the same time. (Raghu Angadi)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.18@732575 13f79535-47bb-0310-9956-ffa450edef68
Raghu Angadi 16 năm trước cách đây
mục cha
commit
8759225942
2 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 3 0
      CHANGES.txt
  2. 8 1
      src/hdfs/org/apache/hadoop/dfs/DataNode.java

+ 3 - 0
CHANGES.txt

@@ -130,6 +130,9 @@ Release 0.18.3 - Unreleased
     HADOOP-4961. Fix ConcurrentModificationException in lease recovery 
     of empty files. (shv)
 
+    HADOOP-4971. A long (unexpected) delay at datanodes could make subsequent
+    block reports from many datanode at the same time. (Raghu Angadi)
+    
 Release 0.18.2 - 2008-11-03
 
   BUG FIXES

+ 8 - 1
src/hdfs/org/apache/hadoop/dfs/DataNode.java

@@ -755,7 +755,14 @@ public class DataNode extends Configured
             lastBlockReport = startTime - R.nextInt((int)(blockReportInterval));
             resetBlockReportTime = false;
           } else {
-            lastBlockReport = startTime;
+            /* say the last block report was at 8:20:14. The current report 
+             * should have started around 9:20:14 (default 1 hour interval). 
+             * If current time is :
+             *   1) normal like 9:20:18, next report should be at 10:20:14
+             *   2) unexpected like 11:35:43, next report should be at 12:20:14
+             */
+            lastBlockReport += (now() - lastBlockReport) / 
+                               blockReportInterval * blockReportInterval;
           }
           processCommand(cmd);
         }