瀏覽代碼

MAPREDUCE-4499. Looking for speculative tasks is very expensive in 1.x (Koji Noguchi via tgraves)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1378614 13f79535-47bb-0310-9956-ffa450edef68
Thomas Graves 12 年之前
父節點
當前提交
cbe3182625
共有 2 個文件被更改,包括 13 次插入12 次删除
  1. 3 0
      CHANGES.txt
  2. 10 12
      src/mapred/org/apache/hadoop/mapred/JobInProgress.java

+ 3 - 0
CHANGES.txt

@@ -103,6 +103,9 @@ Release 1.2.0 - unreleased
     MAPREDUCE-4408. allow jobs to set a JAR that is in the distributed cached 
     (rkanter via tucu)
 
+    MAPREDUCE-4499. Looking for speculative tasks is very expensive in 1.x
+    (Koji Noguchi via tgraves)
+
   OPTIMIZATIONS
 
     HDFS-2533. Backport: Remove needless synchronization on some FSDataSet

+ 10 - 12
src/mapred/org/apache/hadoop/mapred/JobInProgress.java

@@ -2246,21 +2246,19 @@ public class JobInProgress {
         continue;
       }
 
-      if (!tip.hasRunOnMachine(ttStatus.getHost(), 
+      if (tip.hasSpeculativeTask(currentTime, avgProgress)) {
+        // Check if this tip can be removed from the list.
+        // If the list is shared then we should not remove.
+        if(shouldRemove){
+          iter.remove();
+        }
+        if (!tip.hasRunOnMachine(ttStatus.getHost(),
                                ttStatus.getTrackerName())) {
-        if (tip.hasSpeculativeTask(currentTime, avgProgress)) {
-          // In case of shared list we don't remove it. Since the TIP failed 
-          // on this tracker can be scheduled on some other tracker.
-          if (shouldRemove) {
-            iter.remove(); //this tracker is never going to run it again
-          }
           return tip;
-        } 
+        }
       } else {
-        // Check if this tip can be removed from the list.
-        // If the list is shared then we should not remove.
-        if (shouldRemove) {
-          // This tracker will never speculate this tip
+        if (shouldRemove && tip.hasRunOnMachine(ttStatus.getHost(),
+                                         ttStatus.getTrackerName())) {
           iter.remove();
         }
       }