diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 5f41d2e5de..f3c4d0aa47 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -264,6 +264,9 @@ Release 2.5.0 - UNRELEASED MAPREDUCE-5920. Add Xattr option in DistCp docs. (Yi Liu via cnauroth) + MAPREDUCE-5924. Changed TaskAttemptImpl to ignore TA_COMMIT_PENDING event + at COMMIT_PENDING state. (Zhijie Shen via jianhe) + Release 2.4.1 - 2014-06-23 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java index 56e7db647a..f33c58e9e4 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java @@ -335,6 +335,15 @@ TaskAttemptEventType.TA_CONTAINER_CLEANED, new KilledTransition()) .addTransition(TaskAttemptStateInternal.COMMIT_PENDING, TaskAttemptStateInternal.FAIL_CONTAINER_CLEANUP, TaskAttemptEventType.TA_TIMED_OUT, CLEANUP_CONTAINER_TRANSITION) + // AM is likely to receive duplicate TA_COMMIT_PENDINGs as the task attempt + // will re-send the commit message until it doesn't encounter any + // IOException and succeeds in delivering the commit message. + // Ignoring the duplicate commit message is a short-term fix. In long term, + // we need to make use of retry cache to help this and other MR protocol + // APIs that can be considered as @AtMostOnce. + .addTransition(TaskAttemptStateInternal.COMMIT_PENDING, + TaskAttemptStateInternal.COMMIT_PENDING, + TaskAttemptEventType.TA_COMMIT_PENDING) // Transitions from SUCCESS_CONTAINER_CLEANUP state // kill and cleanup the container diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestMRApp.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestMRApp.java index 8baddc82a7..b03d58d01a 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestMRApp.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestMRApp.java @@ -112,6 +112,15 @@ public void testCommitPending() throws Exception { //wait for first attempt to commit pending app.waitForState(attempt, TaskAttemptState.COMMIT_PENDING); + //re-send the commit pending signal to the task + app.getContext().getEventHandler().handle( + new TaskAttemptEvent( + attempt.getID(), + TaskAttemptEventType.TA_COMMIT_PENDING)); + + //the task attempt should be still at COMMIT_PENDING + app.waitForState(attempt, TaskAttemptState.COMMIT_PENDING); + //send the done signal to the task app.getContext().getEventHandler().handle( new TaskAttemptEvent(