Repository: ambari Updated Branches: refs/heads/trunk 1f55ea3b0 -> 69f0b6d7f
AMBARI-19571 - Check python code for RU/EU checks to see if HOU should be considered (jonathanhurley) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/69f0b6d7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/69f0b6d7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/69f0b6d7 Branch: refs/heads/trunk Commit: 69f0b6d7f1d5ade01b4d0876898ed8323862ae70 Parents: 1f55ea3 Author: Jonathan Hurley <[email protected]> Authored: Mon Jan 16 09:46:50 2017 -0500 Committer: Jonathan Hurley <[email protected]> Committed: Mon Jan 16 10:53:49 2017 -0500 ---------------------------------------------------------------------- .../HDFS/2.1.0.2.0/package/scripts/datanode.py | 5 ++++- .../HDFS/2.1.0.2.0/package/scripts/journalnode.py | 5 +++-- .../HDFS/3.0.0.3.0/package/scripts/journalnode.py | 5 +++-- .../ZOOKEEPER/3.4.5/package/scripts/zookeeper_server.py | 9 +++++---- 4 files changed, 15 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/69f0b6d7/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py index 130c021..924eea4 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py @@ -17,6 +17,9 @@ limitations under the License. """ import datanode_upgrade + +from ambari_commons.constants import UPGRADE_TYPE_ROLLING + from hdfs_datanode import datanode from resource_management.libraries.script.script import Script from resource_management.libraries.functions import conf_select, stack_select @@ -66,7 +69,7 @@ class DataNode(Script): # pre-upgrade steps shutdown the datanode, so there's no need to call hdfs_binary = self.get_hdfs_binary() - if upgrade_type == "rolling": + if upgrade_type == UPGRADE_TYPE_ROLLING: stopped = datanode_upgrade.pre_rolling_upgrade_shutdown(hdfs_binary) if not stopped: datanode(action="stop") http://git-wip-us.apache.org/repos/asf/ambari/blob/69f0b6d7/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py index 46df454..9448fa6 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py +++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/journalnode.py @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. """ +from ambari_commons.constants import UPGRADE_TYPE_NON_ROLLING from resource_management.libraries.script.script import Script from resource_management.libraries.functions import conf_select, stack_select from resource_management.libraries.functions.constants import StackFeature from resource_management.libraries.functions.stack_features import check_stack_feature -from resource_management.libraries.functions.format import format from resource_management.libraries.functions.check_process_status import check_process_status from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ @@ -67,7 +67,8 @@ class JournalNodeDefault(JournalNode): ) def post_upgrade_restart(self, env, upgrade_type=None): - if upgrade_type == "nonrolling": + # express upgrade cannot determine if the JN quorum is established + if upgrade_type == UPGRADE_TYPE_NON_ROLLING: return Logger.info("Executing Stack Upgrade post-restart") http://git-wip-us.apache.org/repos/asf/ambari/blob/69f0b6d7/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/journalnode.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/journalnode.py b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/journalnode.py index 46df454..9448fa6 100644 --- a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/journalnode.py +++ b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/journalnode.py @@ -16,12 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. """ +from ambari_commons.constants import UPGRADE_TYPE_NON_ROLLING from resource_management.libraries.script.script import Script from resource_management.libraries.functions import conf_select, stack_select from resource_management.libraries.functions.constants import StackFeature from resource_management.libraries.functions.stack_features import check_stack_feature -from resource_management.libraries.functions.format import format from resource_management.libraries.functions.check_process_status import check_process_status from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ @@ -67,7 +67,8 @@ class JournalNodeDefault(JournalNode): ) def post_upgrade_restart(self, env, upgrade_type=None): - if upgrade_type == "nonrolling": + # express upgrade cannot determine if the JN quorum is established + if upgrade_type == UPGRADE_TYPE_NON_ROLLING: return Logger.info("Executing Stack Upgrade post-restart") http://git-wip-us.apache.org/repos/asf/ambari/blob/69f0b6d7/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5/package/scripts/zookeeper_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5/package/scripts/zookeeper_server.py index 3f2502a..c2d76be 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5/package/scripts/zookeeper_server.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5/package/scripts/zookeeper_server.py @@ -19,21 +19,21 @@ Ambari Agent """ import random -import sys + +from ambari_commons.constants import UPGRADE_TYPE_NON_ROLLING from resource_management.libraries.script.script import Script from resource_management.libraries.functions import get_unique_id_and_date from resource_management.libraries.functions import conf_select from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import StackFeature -from resource_management.libraries.functions.version import compare_versions, format_stack_version +from resource_management.libraries.functions.version import format_stack_version from resource_management.libraries.functions.stack_features import check_stack_feature from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ FILE_TYPE_JAAS_CONF from resource_management.core import shell from resource_management.core.logger import Logger -from resource_management.core.resources.system import Execute from resource_management.libraries.functions.check_process_status import check_process_status from resource_management.libraries.functions.format import format from resource_management.libraries.functions.validate import call_and_match_output @@ -81,7 +81,8 @@ class ZookeeperServerLinux(ZookeeperServer): stack_select.select("zookeeper-server", params.version) def post_upgrade_restart(self, env, upgrade_type=None): - if upgrade_type == "nonrolling": + # during an express upgrade, there is no quorum, so don't try to perform the check + if upgrade_type == UPGRADE_TYPE_NON_ROLLING: return Logger.info("Executing Stack Upgrade post-restart")
