hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r746275 - in /hadoop/core/branches/branch-0.20: ./ CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobInProgress.java
Date Fri, 20 Feb 2009 15:22:05 GMT
Author: yhemanth
Date: Fri Feb 20 15:22:03 2009
New Revision: 746275

URL: http://svn.apache.org/viewvc?rev=746275&view=rev
Log:
Merge -r 746273:746274 from trunk to branch 0.20 to fix HADOOP-5282.

Modified:
    hadoop/core/branches/branch-0.20/   (props changed)
    hadoop/core/branches/branch-0.20/CHANGES.txt   (contents, props changed)
    hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java

Propchange: hadoop/core/branches/branch-0.20/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 20 15:22:03 2009
@@ -1,2 +1,2 @@
 /hadoop/core/branches/branch-0.19:713112
-/hadoop/core/trunk:727001,727117,727191,727212,727217,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,736426,738328,738697,740077,740157,741703,741762,743745,743816,743892,744894,745180,746010,746206,746227,746233
+/hadoop/core/trunk:727001,727117,727191,727212,727217,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,736426,738328,738697,740077,740157,741703,741762,743745,743816,743892,744894,745180,746010,746206,746227,746233,746274

Modified: hadoop/core/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=746275&r1=746274&r2=746275&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.20/CHANGES.txt Fri Feb 20 15:22:03 2009
@@ -630,6 +630,9 @@
     job is not in memory and a tasktracker comes to the jobtracker with a status
     report of a task belonging to that job. (Amar Kamat via ddas)
 
+    HADOOP-5282. Fixed job history logs for task attempts that are failed by the
+    JobTracker, say due to lost task trackers. (Amar Kamat via yhemanth)
+
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS

Propchange: hadoop/core/branches/branch-0.20/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 20 15:22:03 2009
@@ -1,3 +1,3 @@
 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226
 /hadoop/core/branches/branch-0.19/CHANGES.txt:713112
-/hadoop/core/trunk/CHANGES.txt:727001,727117,727191,727212,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,735082,736426,738602,738697,739416,740077,740157,741703,741762,743296,743745,743816,743892,744894,745180,745268,746010,746193,746206,746227,746233
+/hadoop/core/trunk/CHANGES.txt:727001,727117,727191,727212,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,735082,736426,738602,738697,739416,740077,740157,741703,741762,743296,743745,743816,743892,744894,745180,745268,746010,746193,746206,746227,746233,746274

Modified: hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=746275&r1=746274&r2=746275&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
(original)
+++ hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
Fri Feb 20 15:22:03 2009
@@ -1992,10 +1992,7 @@
     TaskTrackerStatus ttStatus = 
       this.jobtracker.getTaskTracker(status.getTaskTracker());
     String trackerHostname = jobtracker.getNode(ttStatus.getHost()).toString();
-    String taskType = tip.isJobCleanupTask() ? Values.CLEANUP.name() :
-                      tip.isJobSetupTask() ? Values.SETUP.name() :
-                      tip.isMapTask() ? Values.MAP.name() : 
-                      Values.REDUCE.name();
+    String taskType = getTaskType(tip);
     if (status.getIsMap()){
       JobHistory.MapAttempt.logStarted(status.getTaskID(), status.getStartTime(), 
                                        status.getTaskTracker(), 
@@ -2306,10 +2303,7 @@
     List<String> taskDiagnosticInfo = tip.getDiagnosticInfo(taskid);
     String diagInfo = taskDiagnosticInfo == null ? "" :
       StringUtils.arrayToString(taskDiagnosticInfo.toArray(new String[0]));
-    String taskType = tip.isJobCleanupTask() ? Values.CLEANUP.name() :
-                      tip.isJobSetupTask() ? Values.SETUP.name() :
-                      tip.isMapTask() ? Values.MAP.name() : 
-                      Values.REDUCE.name();
+    String taskType = getTaskType(tip);
     if (taskStatus.getIsMap()) {
       JobHistory.MapAttempt.logStarted(taskid, startTime, 
         taskTrackerName, taskTrackerPort, taskType);
@@ -2432,12 +2426,14 @@
                                                     trackerName, phase,
                                                     new Counters());
     status.setFinishTime(System.currentTimeMillis());
+    boolean wasComplete = tip.isComplete();
     updateTaskStatus(tip, status, metrics);
-    JobHistory.Task.logFailed(tip.getTIPId(), 
-                              tip.isJobCleanupTask() ? Values.CLEANUP.name() : 
-                              tip.isJobSetupTask() ? Values.SETUP.name() : 
-                              tip.isMapTask() ? Values.MAP.name() : Values.REDUCE.name(),

-                              tip.getExecFinishTime(), reason, taskid); 
+    boolean isComplete = tip.isComplete();
+    if (wasComplete && !isComplete) { // mark a successful tip as failed
+      String taskType = getTaskType(tip);
+      JobHistory.Task.logFailed(tip.getTIPId(), taskType, 
+                                tip.getExecFinishTime(), reason, taskid);
+    }
   }
        
                            
@@ -2611,4 +2607,19 @@
   boolean isComplete() {
     return status.isJobComplete();
   }
+  
+  /**
+   * Get the task type for logging it to {@link JobHistory}.
+   */
+  private String getTaskType(TaskInProgress tip) {
+    if (tip.isJobCleanupTask()) {
+      return Values.CLEANUP.name();
+    } else if (tip.isJobSetupTask()) {
+      return Values.SETUP.name();
+    } else if (tip.isMapTask()) {
+      return Values.MAP.name();
+    } else {
+      return Values.REDUCE.name();
+    }
+  }
 }



Mime
View raw message