YARN-6323. Rolling upgrade/config change is broken on timeline v2. (Vrushali C via Haibo Chen)

This commit is contained in:
Haibo Chen 2017-08-21 10:45:10 -07:00 committed by Varun Saxena
parent b2efebdd07
commit 9b08f365d7
2 changed files with 12 additions and 0 deletions

View File

@ -2221,6 +2221,8 @@ public class YarnConfiguration extends Configuration {
public static final int DEFAULT_NUMBER_OF_ASYNC_ENTITIES_TO_MERGE = 10; public static final int DEFAULT_NUMBER_OF_ASYNC_ENTITIES_TO_MERGE = 10;
/** default version for any flow. */
public static final String DEFAULT_FLOW_VERSION = "1";
/** /**
* The time period for which timeline v2 client will wait for draining * The time period for which timeline v2 client will wait for draining

View File

@ -402,6 +402,16 @@ public class ContainerManagerImpl extends CompositeService implements
LOG.debug( LOG.debug(
"Recovering Flow context: " + fc + " for an application " + appId); "Recovering Flow context: " + fc + " for an application " + appId);
} }
} else {
// in upgrade situations, where there is no prior existing flow context,
// default would be used.
fc = new FlowContext(TimelineUtils.generateDefaultFlowName(null, appId),
YarnConfiguration.DEFAULT_FLOW_VERSION, appId.getClusterTimestamp());
if (LOG.isDebugEnabled()) {
LOG.debug(
"No prior existing flow context found. Using default Flow context: "
+ fc + " for an application " + appId);
}
} }
LOG.info("Recovering application " + appId); LOG.info("Recovering application " + appId);