ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject ambari git commit: AMBARI-12440. RU: hdp-select set all should be called before finalize (ncole)
Date Fri, 17 Jul 2015 12:26:45 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 306f28f55 -> ee08a07c2


AMBARI-12440.  RU: hdp-select set all should be called before finalize (ncole)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ee08a07c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ee08a07c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ee08a07c

Branch: refs/heads/trunk
Commit: ee08a07c2f49fa23966edf7d7869f593182af96b
Parents: 306f28f
Author: Nate Cole <ncole@hortonworks.com>
Authored: Thu Jul 16 16:37:37 2015 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Fri Jul 17 08:26:33 2015 -0400

----------------------------------------------------------------------
 .../stacks/HDP/2.2/upgrades/upgrade-2.2.xml       | 15 ++++++++-------
 .../stacks/HDP/2.2/upgrades/upgrade-2.3.xml       | 16 +++++++++-------
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml       | 16 +++++++++-------
 .../ambari/server/state/UpgradeHelperTest.java    |  8 +++++++-
 .../server/state/stack/UpgradePackTest.java       | 18 ++++++++++++++----
 .../HDP/2.1.1/upgrades/upgrade_direction.xml      |  9 +++++++++
 6 files changed, 56 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ee08a07c/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
index 95834fd..fedba07 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
@@ -267,6 +267,14 @@
       </service>
     </group>
 
+    <group xsi:type="cluster" name="ALL_HOST_OPS" title="Finalize Hosts">
+      <execute-stage title="Update remaining HDP stack to {{version}}">
+        <task xsi:type="execute">
+          <script>scripts/ru_set_all.py</script>
+          <function>actionexecute</function>
+        </task>
+      </execute-stage>
+    </group>
 
     <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}">
       <skippable>true</skippable>
@@ -290,13 +298,6 @@
         </task>
       </execute-stage>
       
-      <execute-stage title="Update remaining HDP stack to {{version}}">
-        <task xsi:type="execute">
-          <script>scripts/ru_set_all.py</script>
-          <function>actionexecute</function>
-        </task>
-      </execute-stage>
-      
       <execute-stage title="Save Cluster State" service="" component="">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction">
         </task>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee08a07c/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
index 20e1a37..5cc30b2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
@@ -287,6 +287,15 @@
       </service>
     </group>
 
+    <group xsi:type="cluster" name="ALL_HOST_OPS" title="Finalize Hosts">
+      <execute-stage title="Update remaining HDP stack to {{version}}">
+        <task xsi:type="execute">
+          <script>scripts/ru_set_all.py</script>
+          <function>actionexecute</function>
+        </task>
+      </execute-stage>
+    </group>
+
     <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}">
       <skippable>true</skippable>
       <execute-stage title="Check Unhealthy Hosts" id="unhealthy-hosts">
@@ -309,13 +318,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage title="Update remaining HDP stack to {{version}}">
-        <task xsi:type="execute">
-          <script>scripts/ru_set_all.py</script>
-          <function>actionexecute</function>
-        </task>
-      </execute-stage>
-
       <execute-stage title="Save Cluster State" service="" component="">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction"
/>
       </execute-stage>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee08a07c/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
index 938d16d..ba16159 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
@@ -307,6 +307,15 @@
       </service>
     </group>
 
+    <group xsi:type="cluster" name="ALL_HOST_OPS" title="Finalize Hosts">
+      <execute-stage title="Update remaining HDP stack to {{version}}">
+        <task xsi:type="execute">
+          <script>scripts/ru_set_all.py</script>
+          <function>actionexecute</function>
+        </task>
+      </execute-stage>
+    </group>
+
     <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize {{direction.text.proper}}">
       <skippable>true</skippable>
       <execute-stage title="Check Unhealthy Hosts" id="unhealthy-hosts">
@@ -329,13 +338,6 @@
         </task>
       </execute-stage>
       
-      <execute-stage title="Update remaining HDP stack to {{version}}">
-        <task xsi:type="execute">
-          <script>scripts/ru_set_all.py</script>
-          <function>actionexecute</function>
-        </task>
-      </execute-stage>
-      
       <execute-stage title="Save Cluster State" service="" component="">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FinalizeUpgradeAction">
         </task>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee08a07c/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
index f5a4a54..6267f53 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/UpgradeHelperTest.java
@@ -940,11 +940,17 @@ public class UpgradeHelperTest {
     assertNotNull(upgrade);
 
     List<UpgradeGroupHolder> groups = m_upgradeHelper.createSequence(upgrade, context);
-    assertEquals(1, groups.size());
+    assertEquals(2, groups.size());
 
     UpgradeGroupHolder group = groups.get(0);
+    assertEquals(1, group.items.size());
+    assertEquals("PRE_POST_CLUSTER", group.name);
+
+    group = groups.get(1);
+    assertEquals("POST_CLUSTER", group.name);
     assertEquals(3, group.items.size());
 
+
     StageWrapper stage = group.items.get(1);
     assertEquals("NameNode Finalize", stage.getText());
     assertEquals(1, stage.getTasks().size());

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee08a07c/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
index a23713f..7a1d522 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
@@ -237,19 +237,29 @@ public class UpgradePackTest {
     UpgradePack up = upgrades.get("upgrade_direction");
 
     List<Grouping> groups = up.getGroups(Direction.UPGRADE);
-    assertEquals(3, groups.size());
+    assertEquals(4, groups.size());
     Grouping group = groups.get(2);
     assertEquals(ClusterGrouping.class, group.getClass());
+    ClusterGrouping cluster_group = (ClusterGrouping) group;
+    assertEquals("Run on All", group.title);
 
-    ClusterGrouping cluster_group = (ClusterGrouping) groups.get(2);
+    cluster_group = (ClusterGrouping) groups.get(3);
     List<ExecuteStage> stages = cluster_group.executionStages;
     assertEquals(3, stages.size());
     assertNotNull(stages.get(0).intendedDirection);
     assertEquals(Direction.DOWNGRADE, stages.get(0).intendedDirection);
 
     groups = up.getGroups(Direction.DOWNGRADE);
-    assertEquals(2, groups.size());
-    assertEquals(ClusterGrouping.class, groups.get(1).getClass());
+    assertEquals(3, groups.size());
+    // there are two clustergroupings at the end
+    group = groups.get(1);
+    assertEquals(ClusterGrouping.class, group.getClass());
+    assertEquals("Run on All", group.title);
+
+    group = groups.get(2);
+    assertEquals(ClusterGrouping.class, group.getClass());
+    assertEquals("Finalize Upgrade", group.title);
+
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee08a07c/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_direction.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_direction.xml
b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_direction.xml
index 538b237..89a9e4f 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_direction.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_direction.xml
@@ -34,6 +34,15 @@
       </priority>
     </group>
     
+    <group xsi:type="cluster" name="PRE_POST_CLUSTER" title="Run on All">
+      <execute-stage title="Host Finalize" service="HDFS" component="NAMENODE" >
+        <task xsi:type="execute" hosts="master">
+          <script>scripts/ru_run_all.py</script>
+          <function>actionexecute</function>
+        </task>
+      </execute-stage>      
+    </group>
+    
     <group xsi:type="cluster" name="POST_CLUSTER" title="Finalize Upgrade">
       <execute-stage title="Direction Downgrade Only">
         <direction>DOWNGRADE</direction>


Mime
View raw message