ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alejan...@apache.org
Subject ambari git commit: AMBARI-13548. Stop-and-Start Upgrade: NameNode restart fails since HdfsResource only_if condition not working, change title of Groups (alejandro)
Date Fri, 23 Oct 2015 21:21:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 2c5694b80 -> 7a54da06d


AMBARI-13548. Stop-and-Start Upgrade: NameNode restart fails since HdfsResource only_if condition
not working, change title of Groups (alejandro)


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

Branch: refs/heads/trunk
Commit: 7a54da06dc36140643afad9eca56a45c9d7294f2
Parents: 2c5694b
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Fri Oct 23 11:38:29 2015 -0700
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Fri Oct 23 14:21:26 2015 -0700

----------------------------------------------------------------------
 .../resource_management/core/environment.py       |  4 ++++
 .../2.1.0.2.0/package/scripts/hdfs_namenode.py    |  4 ++--
 .../HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml   | 14 +++++++-------
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml   | 14 +++++++-------
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml   | 14 +++++++-------
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml   | 14 +++++++-------
 .../python/stacks/2.0.6/HDFS/test_namenode.py     | 18 +++++++++---------
 7 files changed, 43 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7a54da06/ambari-common/src/main/python/resource_management/core/environment.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/environment.py b/ambari-common/src/main/python/resource_management/core/environment.py
index 134f164..9fd5c3a 100644
--- a/ambari-common/src/main/python/resource_management/core/environment.py
+++ b/ambari-common/src/main/python/resource_management/core/environment.py
@@ -23,6 +23,7 @@ Ambari Agent
 __all__ = ["Environment"]
 
 import os
+import types
 import logging
 import shutil
 import time
@@ -120,6 +121,9 @@ class Environment(object):
     provider_action()
 
   def _check_condition(self, cond):
+    if type(cond) == types.BooleanType:
+      return cond
+
     if hasattr(cond, '__call__'):
       return cond()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a54da06/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
index 98b8afd..57f5e54 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_namenode.py
@@ -123,12 +123,12 @@ def namenode(action=None, hdfs_binary=None, do_format=True, upgrade_type=None,
e
     if params.dfs_ha_enabled:
       is_active_namenode_cmd = as_user(format("{hdfs_binary} --config {hadoop_conf_dir} haadmin
-getServiceState {namenode_id} | grep active"), params.hdfs_user, env={'PATH':params.hadoop_bin_dir})
     else:
-      is_active_namenode_cmd = None
+      is_active_namenode_cmd = False
     
     # During NonRolling Upgrade, both NameNodes are initially down,
     # so no point in checking if this is the active or standby.
     if upgrade_type == "nonrolling":
-      is_active_namenode_cmd = None
+      is_active_namenode_cmd = False
 
     # ___Scenario___________|_Expected safemode state__|_Wait for safemode OFF____|
     # no-HA                 | ON -> OFF                | Yes                      |

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a54da06/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
b/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
index a71c379..5c3fa87 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
@@ -46,7 +46,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="stop" name="Stop High-Level Daemons" title="Stop Daemons for High-Level
Services">
+    <group xsi:type="stop" name="STOP_HIGH_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for High-Level Services">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -87,7 +87,7 @@
       </service>
     </group>
 
-    <group xsi:type="cluster" name="Backups" title="Take Backups">
+    <group xsi:type="cluster" name="Backups" title="Perform Backups">
       <direction>UPGRADE</direction>
       <skippable>true</skippable>
       <execute-stage service="OOZIE" component="OOZIE_SERVER" title="Backup Oozie Database">
@@ -117,7 +117,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="stop" name="Stop Low-Level Daemons" title="Stop Daemons for Low-Level
Services">
+    <group xsi:type="stop" name="STOP_LOW_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for Core Services (HDFS, HBase, ZooKeeper and Ranger)">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -291,8 +291,8 @@
     </group>
 
     <!-- After processing this group, will change the effective Stack of the UpgradeContext
object. -->
-    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Desired
Stack Id">
-      <execute-stage title="Update Desired Stack Id" service="" component="">
+    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Target
Stack">
+      <execute-stage title="Update Target Stack" service="" component="">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.UpdateDesiredStackAction">
         </task>
       </execute-stage>
@@ -310,7 +310,7 @@
 
     <!-- Now, restart all of the services. -->
 
-    <group xsi:type="restart" name="ZOOKEEPER" title="Zookeeper">
+    <group xsi:type="restart" name="ZOOKEEPER" title="ZooKeeper">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="ZOOKEEPER">
@@ -346,7 +346,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="restart" name="MR and YARN" title="MR and YARN">
+    <group xsi:type="restart" name="YARN and MapReduce2" title="YARN and MapReduce2">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="MAPREDUCE2">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a54da06/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml
index 5aacfa0..c245cc5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml
@@ -46,7 +46,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="stop" name="Stop High-Level Daemons" title="Stop Daemons for High-Level
Services">
+    <group xsi:type="stop" name="STOP_HIGH_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for High-Level Services">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -99,7 +99,7 @@
       </service>
     </group>
 
-    <group xsi:type="cluster" name="Backups" title="Take Backups">
+    <group xsi:type="cluster" name="Backups" title="Perform Backups">
       <direction>UPGRADE</direction>
       <skippable>true</skippable>
       <execute-stage service="OOZIE" component="OOZIE_SERVER" title="Backup Oozie Database">
@@ -141,7 +141,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="stop" name="Stop Low-Level Daemons" title="Stop Daemons for Low-Level
Services">
+    <group xsi:type="stop" name="STOP_LOW_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for Core Services (HDFS, HBase, ZooKeeper and Ranger)">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -220,8 +220,8 @@
     </group>
 
     <!-- After processing this group, will change the effective Stack of the UpgradeContext
object. -->
-    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Desired
Stack Id">
-      <execute-stage title="Update Desired Stack Id" service="" component="">
+    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Target
Stack">
+      <execute-stage title="Update Target Stack" service="" component="">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.UpdateDesiredStackAction">
         </task>
       </execute-stage>
@@ -239,7 +239,7 @@
 
     <!-- Now, restart all of the services. -->
 
-    <group xsi:type="restart" name="ZOOKEEPER" title="Zookeeper">
+    <group xsi:type="restart" name="ZOOKEEPER" title="ZooKeeper">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="ZOOKEEPER">
@@ -284,7 +284,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="restart" name="MR and YARN" title="MR and YARN">
+    <group xsi:type="restart" name="YARN and MapReduce2" title="YARN and MapReduce2">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="MAPREDUCE2">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a54da06/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml
b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml
index 9997c12..abf142e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml
@@ -48,7 +48,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="stop" name="Stop High-Level Daemons" title="Stop Daemons for High-Level
Services">
+    <group xsi:type="stop" name="STOP_HIGH_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for High-Level Services">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -101,7 +101,7 @@
       </service>
     </group>
 
-    <group xsi:type="cluster" name="Backups" title="Take Backups">
+    <group xsi:type="cluster" name="Backups" title="Perform Backups">
       <direction>UPGRADE</direction>
       <skippable>true</skippable>
       <execute-stage service="OOZIE" component="OOZIE_SERVER" title="Backup Oozie Database">
@@ -146,7 +146,7 @@
       <!--TODO: Ranger KMS seems to be absent at 2.2 stack, not backing it up-->
     </group>
 
-    <group xsi:type="stop" name="Stop Low-Level Daemons" title="Stop Daemons for Low-Level
Services">
+    <group xsi:type="stop" name="STOP_LOW_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for Core Services (HDFS, HBase, ZooKeeper and Ranger)">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -447,8 +447,8 @@
 
 
     <!-- After processing this group, will change the effective Stack of the UpgradeContext
object. -->
-    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Desired
Stack Id">
-      <execute-stage title="Update Desired Stack Id" service="" component="">
+    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Target
Stack">
+      <execute-stage title="Update Target Stack" service="" component="">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.UpdateDesiredStackAction">
         </task>
       </execute-stage>
@@ -466,7 +466,7 @@
 
     <!-- Now, restart all of the services. -->
 
-    <group xsi:type="restart" name="ZOOKEEPER" title="Zookeeper">
+    <group xsi:type="restart" name="ZOOKEEPER" title="ZooKeeper">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="ZOOKEEPER">
@@ -512,7 +512,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="restart" name="MR and YARN" title="MR and YARN">
+    <group xsi:type="restart" name="YARN and MapReduce2" title="YARN and MapReduce2">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="MAPREDUCE2">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a54da06/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 e92a413..6eca441 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
@@ -47,7 +47,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="stop" name="Stop High-Level Daemons" title="Stop Daemons for High-Level
Services">
+    <group xsi:type="stop" name="STOP_HIGH_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for High-Level Services">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -100,7 +100,7 @@
       </service>
     </group>
 
-    <group xsi:type="cluster" name="Backups" title="Take Backups">
+    <group xsi:type="cluster" name="Backups" title="Perform Backups">
       <direction>UPGRADE</direction>
       <skippable>true</skippable>
       <execute-stage service="OOZIE" component="OOZIE_SERVER" title="Backup Oozie Database">
@@ -149,7 +149,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="stop" name="Stop Low-Level Daemons" title="Stop Daemons for Low-Level
Services">
+    <group xsi:type="stop" name="STOP_LOW_LEVEL_SERVICE_COMPONENTS" title="Stop Components
for Core Services (HDFS, HBase, ZooKeeper and Ranger)">
       <skippable>true</skippable>
       <service-check>false</service-check>
 
@@ -231,8 +231,8 @@
     </group>
 
     <!-- After processing this group, will change the effective Stack of the UpgradeContext
object. -->
-    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Desired
Stack Id">
-      <execute-stage title="Update Desired Stack Id" service="" component="">
+    <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Target
Stack">
+      <execute-stage title="Update Target Stack" service="" component="">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.UpdateDesiredStackAction">
         </task>
       </execute-stage>
@@ -250,7 +250,7 @@
 
     <!-- Now, restart all of the services. -->
 
-    <group xsi:type="restart" name="ZOOKEEPER" title="Zookeeper">
+    <group xsi:type="restart" name="ZOOKEEPER" title="ZooKeeper">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="ZOOKEEPER">
@@ -297,7 +297,7 @@
       </execute-stage>
     </group>
 
-    <group xsi:type="restart" name="MR and YARN" title="MR and YARN">
+    <group xsi:type="restart" name="YARN and MapReduce2" title="YARN and MapReduce2">
       <service-check>false</service-check>
       <skippable>true</skippable>
       <service name="MAPREDUCE2">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a54da06/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index afa404c..857cea6 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -95,7 +95,7 @@ class TestNamenode(RMFTestCase):
     )
     self.assertResourceCalled('HdfsResource', '/tmp',
         security_enabled = False,
-        only_if=None,
+        only_if=False,
         keytab = UnknownConfigurationMock(),
         hadoop_bin_dir = '/usr/bin',
         default_fs = 'wasb://abc@c6401.ambari.apache.org',
@@ -112,7 +112,7 @@ class TestNamenode(RMFTestCase):
     )
     self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
         security_enabled = False,
-        only_if=None,
+        only_if=False,
         keytab = UnknownConfigurationMock(),
         hadoop_bin_dir = '/usr/bin',
         default_fs = 'wasb://abc@c6401.ambari.apache.org',
@@ -129,7 +129,7 @@ class TestNamenode(RMFTestCase):
     )
     self.assertResourceCalled('HdfsResource', None,
         security_enabled = False,
-        only_if=None,
+        only_if=False,
         keytab = UnknownConfigurationMock(),
         hadoop_bin_dir = '/usr/bin',
         default_fs = 'wasb://abc@c6401.ambari.apache.org',
@@ -208,7 +208,7 @@ class TestNamenode(RMFTestCase):
     )
     self.assertResourceCalled('HdfsResource', '/tmp',
         security_enabled = False,
-        only_if = None,
+        only_if = False,
         keytab = UnknownConfigurationMock(),
         hadoop_bin_dir = '/usr/bin',
         default_fs = 'hdfs://c6401.ambari.apache.org:8020',
@@ -225,7 +225,7 @@ class TestNamenode(RMFTestCase):
     )
     self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
         security_enabled = False,
-        only_if = None,
+        only_if = False,
         keytab = UnknownConfigurationMock(),
         hadoop_bin_dir = '/usr/bin',
         default_fs = 'hdfs://c6401.ambari.apache.org:8020',
@@ -242,7 +242,7 @@ class TestNamenode(RMFTestCase):
     )
     self.assertResourceCalled('HdfsResource', None,
         security_enabled = False,
-        only_if = None,
+        only_if = False,
         keytab = UnknownConfigurationMock(),
         hadoop_bin_dir = '/usr/bin',
         default_fs = 'hdfs://c6401.ambari.apache.org:8020',
@@ -354,7 +354,7 @@ class TestNamenode(RMFTestCase):
         type = 'directory',
         action = ['create_on_execute'], hdfs_site=self.getConfig()['configurations']['hdfs-site'],
principal_name='hdfs', default_fs='hdfs://c6401.ambari.apache.org:8020',
         mode = 0777,
-        only_if = None
+        only_if = False
     )
     self.assertResourceCalled('HdfsResource', '/user/ambari-qa',
         security_enabled = True,
@@ -368,11 +368,11 @@ class TestNamenode(RMFTestCase):
         type = 'directory',
         action = ['create_on_execute'], hdfs_site=self.getConfig()['configurations']['hdfs-site'],
principal_name='hdfs', default_fs='hdfs://c6401.ambari.apache.org:8020',
         mode = 0770,
-        only_if = None
+        only_if = False
     )
     self.assertResourceCalled('HdfsResource', None,
         security_enabled = True,
-        only_if = None,
+        only_if = False,
         keytab = '/etc/security/keytabs/hdfs.headless.keytab',
         hadoop_bin_dir = '/usr/bin',
         kinit_path_local = '/usr/bin/kinit',


Mime
View raw message