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.

(cherry picked from commit a5657182a7)
This commit is contained in:
Vinod Kumar Vavilapalli 2014-11-07 09:28:36 -08:00
parent a3496b7e01
commit eb01c602ed
3 changed files with 12 additions and 1 deletions

View File

@ -861,6 +861,10 @@ Release 2.6.0 - UNRELEASED
YARN-2744. Fixed CapacityScheduler to validate node-labels correctly against
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
INCOMPATIBLE CHANGES

View File

@ -1021,6 +1021,10 @@ public class RMAppAttemptImpl implements RMAppAttempt, Recoverable {
// state but application is not in final state.
if (rmApp.getCurrentAppAttempt() == appAttempt
&& !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(
appAttempt, event);
}

View File

@ -440,7 +440,10 @@ public class TestRMRestart extends ParameterizedSchedulerTestBase {
nm1.registerNode();
// 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);
// fail the AM by sending CONTAINER_FINISHED event without registering.