AMBARI-19006. EU to message users to start YARN queues if work preserving recovery is disabled (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/63938e09 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/63938e09 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/63938e09 Branch: refs/heads/branch-dev-patch-upgrade Commit: 63938e09ca9e79ee541dd51104964322192e293f Parents: 88e0c29 Author: Alejandro Fernandez <afernan...@hortonworks.com> Authored: Mon Nov 28 18:05:41 2016 -0800 Committer: Alejandro Fernandez <afernan...@hortonworks.com> Committed: Thu Dec 1 09:55:33 2016 -0800 ---------------------------------------------------------------------- .../stack/upgrade/ConfigurationCondition.java | 72 +++++++++++++++++--- .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml | 27 +++++--- .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml | 27 +++++--- .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml | 27 +++++--- .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml | 27 +++++--- .../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml | 27 +++++--- .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml | 27 +++++--- .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml | 27 +++++--- .../HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml | 27 +++++--- .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 27 +++++--- .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 27 +++++--- .../src/main/resources/upgrade-pack.xsd | 8 ++- 12 files changed, 231 insertions(+), 119 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java index 1bd88e4..d229270 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java @@ -52,7 +52,37 @@ public final class ConfigurationCondition extends Condition { * Equals comparison. */ @XmlEnumValue("equals") - EQUALS; + EQUALS, + + /** + * Not equals comparison. + */ + @XmlEnumValue("not-equals") + NOT_EQUALS, + + /** + * String contains. + */ + @XmlEnumValue("contains") + CONTAINS, + + /** + * Does not contain. + */ + @XmlEnumValue("not-contains") + NOT_CONTAINS, + + /** + * Exists with any value. + */ + @XmlEnumValue("exists") + EXISTS, + + /** + * Does not exist. + */ + @XmlEnumValue("not-exists") + NOT_EXISTS; } /** @@ -68,12 +98,18 @@ public final class ConfigurationCondition extends Condition { public String property; /** - * The value to compare against. + * The value to compare against; only valid if comparison type is in (=, !=, contains, !contains). */ @XmlAttribute(name = "value") public String value; /** + * The value to return if comparison type is in (=, !=, contains, !contains) and the config is missing. + */ + @XmlAttribute(name = "return_value_if_config_missing") + public boolean returnValueIfConfigMissing; + + /** * The type of comparison to make. */ @XmlAttribute(name = "comparison") @@ -84,7 +120,7 @@ public final class ConfigurationCondition extends Condition { */ @Override public String toString() { - return Objects.toStringHelper(this).add("type", type).add("property", property).add(value, + return Objects.toStringHelper(this).add("type", type).add("property", property).add("value", value).add("comparison", comparisonType).omitNullValues().toString(); } @@ -94,20 +130,40 @@ public final class ConfigurationCondition extends Condition { @Override public boolean isSatisfied(UpgradeContext upgradeContext) { Cluster cluster = upgradeContext.getCluster(); + + boolean propertyExists = false; Config config = cluster.getDesiredConfigByType(type); - if (null == config) { - return false; + Map<String, String> properties = null; + if (null != config) { + properties = config.getProperties(); + if (properties.containsKey(property)) { + propertyExists = true; + } + } + + if (comparisonType == ComparisonType.EXISTS) { + return propertyExists; + } + if (comparisonType == ComparisonType.NOT_EXISTS) { + return !propertyExists; } - Map<String, String> properties = config.getProperties(); - if (MapUtils.isEmpty(properties)) { - return false; + // If property doesn't exist, we cannot make any claims using =, !=, contains !contains. + // Therefore, check if the Upgrade Pack provided a default return value when the config is missing. + if (!propertyExists) { + return returnValueIfConfigMissing; } String propertyValue = properties.get(property); switch (comparisonType) { case EQUALS: return StringUtils.equals(propertyValue, value); + case NOT_EQUALS: + return !StringUtils.equals(propertyValue, value); + case CONTAINS: + return StringUtils.contains(propertyValue, value); + case NOT_CONTAINS: + return !StringUtils.contains(propertyValue, value); default: return false; } http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml index d824309..d274135 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml @@ -36,8 +36,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -416,6 +417,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -633,16 +648,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml index 882e78b..8c9414a 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml @@ -36,8 +36,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -467,6 +468,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -684,16 +699,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml index 24b90b2..37a46d0 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml @@ -47,8 +47,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -611,6 +612,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -828,16 +843,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml index 019c76e..155aaf9 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml @@ -48,8 +48,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -612,6 +613,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -829,16 +844,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml index b7d7983..b9a7e1e 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml @@ -35,8 +35,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -409,6 +410,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -626,16 +641,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml index 3608247..7b9b55e 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml @@ -43,8 +43,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -562,6 +563,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -779,16 +794,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml index 2a1ecf7..92ce832 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml @@ -48,8 +48,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -567,6 +568,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -784,16 +799,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml index 414ce15..6bca487 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml @@ -36,8 +36,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -441,6 +442,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -692,16 +707,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml index c13ad99..66f872d 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml @@ -36,8 +36,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -440,6 +441,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -691,16 +706,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml index d34d476..1c65f9b 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml @@ -36,8 +36,9 @@ <supports-auto-skip-failure>false</supports-auto-skip-failure> <execute-stage service="YARN" component="RESOURCEMANAGER" title="Stop YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> <task xsi:type="manual"> - <message>Before continuing, please stop all YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> + <message>Before continuing, please stop all YARN queues.</message> </task> </execute-stage> @@ -414,6 +415,20 @@ </service> </group> + <group xsi:type="cluster" name="START_YARN_QUEUES" title="Start YARN Queues"> + <direction>UPGRADE</direction> + <service-check>false</service-check> + <skippable>true</skippable> + <parallel-scheduler/> + + <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> + <condition xsi:type="config" type="yarn-site" property="yarn.resourcemanager.work-preserving-recovery.enabled" value="true" comparison="not-equals"/> + <task xsi:type="manual"> + <message>Before continuing, please start all YARN queues.</message> + </task> + </execute-stage> + </group> + <group xsi:type="restart" name="HBASE" title="HBASE"> <service-check>false</service-check> <skippable>true</skippable> @@ -665,16 +680,6 @@ </execute-stage> </group> - <group xsi:type="cluster" name="MANUAL_STEPS" title="Finishing Upgrade"> - <direction>UPGRADE</direction> - - <execute-stage service="YARN" component="RESOURCEMANAGER" title="Start YARN Queues"> - <task xsi:type="manual"> - <message>Please start previously stopped YARN queues. If yarn-site's yarn.resourcemanager.work-preserving-recovery.enabled is set to true, then you can skip this step since the clients will retry on their own.</message> - </task> - </execute-stage> - </group> - <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}"> <skippable>true</skippable> <supports-auto-skip-failure>false</supports-auto-skip-failure> http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/resources/upgrade-pack.xsd ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/upgrade-pack.xsd b/ambari-server/src/main/resources/upgrade-pack.xsd index 45cf5fa..aeec803 100644 --- a/ambari-server/src/main/resources/upgrade-pack.xsd +++ b/ambari-server/src/main/resources/upgrade-pack.xsd @@ -66,6 +66,11 @@ <xs:simpleType name="config-condition-comparison-type"> <xs:restriction base="xs:string"> <xs:enumeration value="equals" /> + <xs:enumeration value="not-equals" /> + <xs:enumeration value="contains" /> + <xs:enumeration value="not-contains" /> + <xs:enumeration value="exists" /> + <xs:enumeration value="not-exists" /> </xs:restriction> </xs:simpleType> @@ -76,7 +81,8 @@ <xs:extension base="abstract-condition-type"> <xs:attribute name="type" type="xs:Name" use="required"/> <xs:attribute name="property" type="xs:Name" use="required"/> - <xs:attribute name="value" type="xs:string" use="required"/> + <xs:attribute name="value" type="xs:string" use="optional"/> + <xs:attribute name="return_value_if_config_missing" type="xs:boolean" use="optional"/> <xs:attribute name="comparison" type="config-condition-comparison-type" use="required"/> </xs:extension> </xs:complexContent>