MAPREDUCE-6711. JobImpl fails to handle preemption events on state COMMITTING. Contributed by Prabhu Joseph.

(cherry picked from commit 679478d0c6)
(cherry picked from commit bf87c523ab)
(cherry picked from commit 031ad740b9)
This commit is contained in:
Junping Du 2017-01-07 22:04:18 -08:00
parent 977fb0c524
commit 01dff41699
2 changed files with 11 additions and 1 deletions

View File

@ -418,7 +418,9 @@ public class JobImpl implements org.apache.hadoop.mapreduce.v2.app.job.Job,
.addTransition(JobStateInternal.COMMITTING, .addTransition(JobStateInternal.COMMITTING,
JobStateInternal.COMMITTING, JobStateInternal.COMMITTING,
EnumSet.of(JobEventType.JOB_UPDATED_NODES, EnumSet.of(JobEventType.JOB_UPDATED_NODES,
JobEventType.JOB_TASK_ATTEMPT_FETCH_FAILURE)) JobEventType.JOB_TASK_ATTEMPT_FETCH_FAILURE,
JobEventType.JOB_TASK_ATTEMPT_COMPLETED,
JobEventType.JOB_MAP_TASK_RESCHEDULED))
// Transitions from SUCCEEDED state // Transitions from SUCCEEDED state
.addTransition(JobStateInternal.SUCCEEDED, JobStateInternal.SUCCEEDED, .addTransition(JobStateInternal.SUCCEEDED, JobStateInternal.SUCCEEDED,

View File

@ -216,6 +216,14 @@ public class TestJobImpl {
completeJobTasks(job); completeJobTasks(job);
assertJobState(job, JobStateInternal.COMMITTING); assertJobState(job, JobStateInternal.COMMITTING);
job.handle(new JobEvent(job.getID(),
JobEventType.JOB_TASK_ATTEMPT_COMPLETED));
assertJobState(job, JobStateInternal.COMMITTING);
job.handle(new JobEvent(job.getID(),
JobEventType.JOB_MAP_TASK_RESCHEDULED));
assertJobState(job, JobStateInternal.COMMITTING);
// let the committer complete and verify the job succeeds // let the committer complete and verify the job succeeds
syncBarrier.await(); syncBarrier.await();
assertJobState(job, JobStateInternal.SUCCEEDED); assertJobState(job, JobStateInternal.SUCCEEDED);