Repository: ambari Updated Branches: refs/heads/branch-2.5 6f63e8426 -> 3e03102de
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/3e03102d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3e03102d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3e03102d Branch: refs/heads/branch-2.5 Commit: 3e03102de3f9066ed866656b44765346668eb9fe Parents: 6f63e84 Author: Jonathan Hurley <[email protected]> Authored: Mon Jan 16 09:46:50 2017 -0500 Committer: Jonathan Hurley <[email protected]> Committed: Mon Jan 16 11:01:02 2017 -0500 ---------------------------------------------------------------------- .../HDFS/2.1.0.2.0/package/scripts/datanode.py | 5 ++++- .../HDFS/2.1.0.2.0/package/scripts/journalnode.py | 5 +++-- .../ZOOKEEPER/3.4.5/package/scripts/zookeeper_server.py | 9 +++++---- 3 files changed, 12 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3e03102d/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 79c32e4..151e26c 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 import * from resource_management.libraries.functions import conf_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/3e03102d/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 9c5a124..efee103 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,13 +16,13 @@ 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 import * 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.stack_features import check_stack_feature -from resource_management.libraries.functions.format import format from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ FILE_TYPE_XML @@ -66,7 +66,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/3e03102d/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 ad5f924..07dbabe 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")
