YARN-2823. Fixed ResourceManager app-attempt state machine to inform schedulers about previous finished attempts of a running appliation to avoid expectation mismatch w.r.t transferred containers. Contributed by Jian He.

This commit is contained in:
Vinod Kumar Vavilapalli 2014-11-07 09:28:36 -08:00
parent 42bbe3794e
commit a5657182a7
3 changed files with 12 additions and 1 deletions

View File

@ -888,6 +888,10 @@ Release 2.6.0 - UNRELEASED
YARN-2744. Fixed CapacityScheduler to validate node-labels correctly against YARN-2744. Fixed CapacityScheduler to validate node-labels correctly against
queues. (Wangda Tan via vinodkv) queues. (Wangda Tan via vinodkv)
YARN-2823. Fixed ResourceManager app-attempt state machine to inform
schedulers about previous finished attempts of a running appliation to avoid
expectation mismatch w.r.t transferred containers. (Jian He via vinodkv)
Release 2.5.2 - UNRELEASED Release 2.5.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -1021,6 +1021,10 @@ public RMAppAttemptState transition(RMAppAttemptImpl appAttempt,
// state but application is not in final state. // state but application is not in final state.
if (rmApp.getCurrentAppAttempt() == appAttempt if (rmApp.getCurrentAppAttempt() == appAttempt
&& !RMAppImpl.isAppInFinalState(rmApp)) { && !RMAppImpl.isAppInFinalState(rmApp)) {
// Add the previous finished attempt to scheduler synchronously so
// that scheduler knows the previous attempt.
appAttempt.scheduler.handle(new AppAttemptAddedSchedulerEvent(
appAttempt.getAppAttemptId(), false, true));
(new BaseFinalTransition(appAttempt.recoveredFinalState)).transition( (new BaseFinalTransition(appAttempt.recoveredFinalState)).transition(
appAttempt, event); appAttempt, event);
} }

View File

@ -440,7 +440,10 @@ public void testRMRestartAppRunningAMFailed() throws Exception {
nm1.registerNode(); nm1.registerNode();
// create app and launch the AM // create app and launch the AM
RMApp app0 = rm1.submitApp(200); RMApp app0 =
rm1.submitApp(200, "name", "user",
new HashMap<ApplicationAccessType, String>(), false, "default", -1,
null, "MAPREDUCE", true, true);
MockAM am0 = launchAM(app0, rm1, nm1); MockAM am0 = launchAM(app0, rm1, nm1);
// fail the AM by sending CONTAINER_FINISHED event without registering. // fail the AM by sending CONTAINER_FINISHED event without registering.