Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 827fc5bc2 -> 4ae5b834d


AMBARI-18591 - Hive Rolling Upgrade Is No Longer Supported In Ambari 
(jonathanhurley)


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

Branch: refs/heads/branch-2.5
Commit: 4ae5b834d384356ac4dd061c97892ab918cb1abf
Parents: 827fc5b
Author: Jonathan Hurley <jhur...@hortonworks.com>
Authored: Thu Oct 13 13:13:39 2016 -0400
Committer: Jonathan Hurley <jhur...@hortonworks.com>
Committed: Fri Oct 14 09:35:18 2016 -0400

----------------------------------------------------------------------
 .../ambari/server/checks/CheckDescription.java  |  6 +-
 .../server/checks/HiveNotRollingWarning.java    | 74 +++++++++++++++
 .../checks/HiveRollingPortChangeWarning.java    | 69 --------------
 .../0.12.0.2.0/package/scripts/hive_server.py   | 27 +++---
 .../package/scripts/hive_server_upgrade.py      | 10 +-
 .../stacks/HDP/2.2/upgrades/config-upgrade.xml  | 52 -----------
 .../stacks/HDP/2.2/upgrades/upgrade-2.2.xml     | 24 -----
 .../stacks/HDP/2.2/upgrades/upgrade-2.3.xml     | 45 ++++-----
 .../stacks/HDP/2.2/upgrades/upgrade-2.4.xml     | 34 ++-----
 .../stacks/HDP/2.3/upgrades/config-upgrade.xml  | 77 ----------------
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml     | 24 -----
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml     | 21 +----
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml     | 21 +----
 .../stacks/HDP/2.4/upgrades/config-upgrade.xml  | 26 ------
 .../stacks/HDP/2.4/upgrades/upgrade-2.4.xml     | 24 -----
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml     | 21 +----
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  | 31 -------
 .../stacks/HDP/2.5/upgrades/upgrade-2.5.xml     | 24 -----
 .../checks/HiveNotRollingWarningTest.java       | 96 ++++++++++++++++++++
 .../HiveRollingPortChangeWarningTest.java       | 96 --------------------
 .../stacks/2.0.6/HIVE/test_hive_server.py       | 27 +++++-
 21 files changed, 244 insertions(+), 585 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index 7fdd0ce..b5cb6ce 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@ -290,12 +290,12 @@ public class CheckDescription {
       .put(AbstractCheckDescriptor.DEFAULT,
           "Kafka is currently not Kerberized, but your cluster is. After 
upgrading, Kafka will automatically be Kerberized for you.").build());
 
-  public static CheckDescription SERVICES_HIVE_ROLLING_PORT_WARNING = new 
CheckDescription("SERVICES_HIVE_ROLLING_PORT_WARNING",
+  public static CheckDescription SERVICES_HIVE_ROLLING_WARNING = new 
CheckDescription("SERVICES_HIVE_ROLLING_WARNING",
     PrereqCheckType.SERVICE,
-    "Hive Server Port Change",
+    "Hive Server Downtime",
     new ImmutableMap.Builder<String, String>()
       .put(AbstractCheckDescriptor.DEFAULT,
-          "In order to support rolling upgrades, the Hive server is required 
to change its port. Applications and users which use a URL that includes the 
port will no longer be able to connect after Hive has upgraded. If this 
behavior is not desired, then the port can be restored to its original value 
after the upgrade has been finalized.").build());
+          "Hive does not currently support rolling upgrades. Hive will be 
upgraded, however existing queries which have been submitted will fail and need 
to be resubmitted after Hive has been upgraded.").build());
   
   public static CheckDescription SERVICES_STORM_ROLLING_WARNING = new 
CheckDescription("SERVICES_STORM_ROLLING_WARNING",
     PrereqCheckType.SERVICE,

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
new file mode 100644
index 0000000..5e44c7c
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+import java.util.Arrays;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.state.stack.PrereqCheckStatus;
+import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+
+import com.google.inject.Singleton;
+
+/**
+ * The {@link HiveNotRollingWarning} to see if Hive is installed and if the
+ * upgrade type is {@link UpgradeType#ROLLING}. If so, then a
+ * {@link PrereqCheckStatus#WARNING} is produced which will let the operator
+ * know that Hive does not support rolling upgrades.
+ * <p/>
+ * In actuality, it does, however in order to support no downtime, a new Hive
+ * server is spun up on a new port while the old server drains. If clients are
+ * not using the ZK discovery service for Hive and connecting via a URL
+ * directly, they will cease to function. For this reason, it's been determined
+ * that at this point in time, Hive will not be upgraded in a rolling fashion.
+ */
+@Singleton
+@UpgradeCheck(group = UpgradeCheckGroup.INFORMATIONAL_WARNING, required = true)
+public class HiveNotRollingWarning extends AbstractCheckDescriptor {
+
+  /**
+   * Constructor.
+   */
+  public HiveNotRollingWarning() {
+    super(CheckDescription.SERVICES_HIVE_ROLLING_WARNING);
+  }
+
+  /**
+   * {@inheritDoc}
+   * <p/>
+   * This check is only applicable if Hive is installed and the upgrade type is
+   * {@link UpgradeType#ROLLING}.
+   */
+  @Override
+  public boolean isApplicable(PrereqCheckRequest request) throws 
AmbariException {
+    boolean isApplicable = super.isApplicable(request, Arrays.asList("HIVE"), 
true);
+    return isApplicable && request.getUpgradeType() == UpgradeType.ROLLING;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest 
request) throws AmbariException {
+    prerequisiteCheck.getFailedOn().add("HIVE");
+    prerequisiteCheck.setStatus(PrereqCheckStatus.WARNING);
+    prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request));
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarning.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarning.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarning.java
deleted file mode 100644
index 3db31ea..0000000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarning.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ambari.server.checks;
-
-import java.util.Arrays;
-
-import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.controller.PrereqCheckRequest;
-import org.apache.ambari.server.state.stack.PrereqCheckStatus;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
-import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
-
-import com.google.inject.Singleton;
-
-/**
- * The {@link HiveRollingPortChangeWarning} to see if Hive is installed and if
- * the upgrade type is {@link UpgradeType#ROLLING}. If so, then a
- * {@link PrereqCheckStatus#WARNING} is produced which will let the operator
- * know that the port for Hive must change in order to preserve the uptime of
- * the service.
- */
-@Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.INFORMATIONAL_WARNING, required = true)
-public class HiveRollingPortChangeWarning extends AbstractCheckDescriptor {
-
-  /**
-   * Constructor.
-   */
-  public HiveRollingPortChangeWarning() {
-    super(CheckDescription.SERVICES_HIVE_ROLLING_PORT_WARNING);
-  }
-
-  /**
-   * {@inheritDoc}
-   * <p/>
-   * This check is only applicable if Hive is installed and the upgrade type is
-   * {@link UpgradeType#ROLLING}.
-   */
-  @Override
-  public boolean isApplicable(PrereqCheckRequest request) throws 
AmbariException {
-    boolean isApplicable = super.isApplicable(request, Arrays.asList("HIVE"), 
true);
-    return isApplicable && request.getUpgradeType() == UpgradeType.ROLLING;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest 
request) throws AmbariException {
-    prerequisiteCheck.getFailedOn().add("HIVE");
-    prerequisiteCheck.setStatus(PrereqCheckStatus.WARNING);
-    prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request));
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
index 942913c..d212f2a 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
@@ -20,12 +20,9 @@ limitations under the License.
 
 
 from resource_management.libraries.script.script import Script
-from resource_management.libraries.resources.hdfs_resource import HdfsResource
 from resource_management.libraries.functions import conf_select
 from resource_management.libraries.functions import stack_select
-from resource_management.libraries.functions import format
 from resource_management.libraries.functions.copy_tarball import copy_to_hdfs
-from resource_management.libraries.functions.get_stack_version import 
get_stack_version
 from resource_management.libraries.functions.check_process_status import 
check_process_status
 from resource_management.libraries.functions import StackFeature
 from resource_management.libraries.functions.stack_features import 
check_stack_feature
@@ -37,7 +34,6 @@ if OSCheck.is_windows_family():
   from resource_management.libraries.functions.windows_service_utils import 
check_windows_service_status
 from setup_ranger_hive import setup_ranger_hive
 from ambari_commons.os_family_impl import OsFamilyImpl
-from ambari_commons.constants import UPGRADE_TYPE_ROLLING
 from resource_management.core.logger import Logger
 
 import hive_server_upgrade
@@ -47,7 +43,6 @@ from hive_service import hive_service
 
 class HiveServer(Script):
   def install(self, env):
-    import params
     self.install_packages(env)
 
   def configure(self, env):
@@ -87,21 +82,23 @@ class HiveServerDefault(HiveServer):
     setup_ranger_hive(upgrade_type=upgrade_type)
     hive_service('hiveserver2', action = 'start', upgrade_type=upgrade_type)
 
-    # only perform this if upgrading and rolling; a non-rolling upgrade 
doesn't need
-    # to do this since hive is already down
-    if upgrade_type == UPGRADE_TYPE_ROLLING:
-      hive_server_upgrade.post_upgrade_deregister()
-
 
   def stop(self, env, upgrade_type=None):
     import params
     env.set_params(params)
 
-    # During rolling upgrade, HiveServer2 should not be stopped before new 
server is available.
-    # Once new server is started, old one is stopped by the --deregister 
command which is 
-    # invoked by the 'hive_server_upgrade.post_upgrade_deregister()' method
-    if upgrade_type != UPGRADE_TYPE_ROLLING:
-      hive_service( 'hiveserver2', action = 'stop' )
+    # always de-register the old hive instance so that ZK can route clients
+    # to the newly created hive server
+    try:
+      if upgrade_type is not None:
+        hive_server_upgrade.deregister()
+    except Exception as exception:
+      Logger.exception(str(exception))
+
+    # even during rolling upgrades, Hive Server will be stopped - this is 
because Ambari will
+    # not support the "port-change/deregister" workflow as it would impact 
Hive clients
+    # which do not use ZK discovery.
+    hive_service( 'hiveserver2', action = 'stop' )
 
 
   def status(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py
index 478c240..17db489 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py
@@ -30,14 +30,18 @@ from resource_management.libraries.functions.stack_features 
import check_stack_f
 from resource_management.libraries.functions.version import 
format_stack_version
 
 
-def post_upgrade_deregister():
+def deregister():
   """
   Runs the "hive --service hiveserver2 --deregister <version>" command to
   de-provision the server in preparation for an upgrade. This will contact
   ZooKeeper to remove the server so that clients that attempt to connect
   will be directed to other servers automatically. Once all
-  clients have drained, the server will shutdown automatically; this process
-  could take a very long time.
+  clients have drained, the server will shutdown automatically.
+
+  However, since Ambari does not support Hive Server rolling upgrades due to 
the port change
+  affecting Hive Clients not using the ZK discovery service, the daemon might 
be forcefully
+  killed before it has been deregistered and drained.
+
   This function will obtain the Kerberos ticket if security is enabled.
   :return:
   """

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/config-upgrade.xml
index 5957da4..2d336ba 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/config-upgrade.xml
@@ -243,51 +243,12 @@
     <service name="HIVE">
       <component name="HIVE_SERVER">
         <changes>
-          <definition xsi:type="configure" 
id="hdp_2_2_0_0_hive_server_set_transport_mode">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10010</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10011</value>
-            </condition>
-          </definition>
-
-          <definition xsi:type="configure" 
id="hdp_2_2_0_0_hive_server_restore_transport_mode_on_downgrade">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10000</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10001</value>
-            </condition>
-          </definition>
-
           <definition xsi:type="configure" 
id="hdp_2_2_0_0_hive_server_delegation_token_store_class">
             <type>hive-site</type>
             <set key="hive.cluster.delegation.token.store.class"
                  value="org.apache.hadoop.hive.thrift.ZooKeeperTokenStore"/>
           </definition>
 
-          <definition xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_set_transport_mode">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10010</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10011</value>
-            </condition>
-          </definition>
-
           <definition xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_replace_auth_manager"
                       summary="Update Hive Authentication Manager">
             <type>hiveserver2-site</type>
@@ -440,19 +401,6 @@
             <transfer operation="delete" delete-key="XAAUDIT.DB.HOSTNAME"/>
           </definition>
 
-          <definition xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_restore_transport_mode_on_downgrade">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10000</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10001</value>
-            </condition>
-          </definition>
-
           <definition xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_remove_datastore_classname">
             <type>hive-site</type>
             <transfer operation="delete" 
delete-key="datanucleus.rdbms.datastoreAdapterClassName"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/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 9f0f421..e585e05 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
@@ -361,12 +361,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -541,24 +535,6 @@
       </component>
 
       <component name="HIVE_SERVER">
-        <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_2_0_0_hive_server_set_transport_mode"/>
-        </pre-upgrade>
-
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_2_0_0_hive_server_restore_transport_mode_on_downgrade"/>
-        </pre-downgrade>
-
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/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 41b516a..da3813c 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
@@ -390,7 +390,7 @@
 
     <group xsi:type="cluster" name="FINALIZE_PRE_CHECK" title="Finalize 
{{direction.text.proper}} Pre-Check">
       <direction>UPGRADE</direction>
-      
+
       <execute-stage title="Check Component Versions">
         <task xsi:type="server_action" 
class="org.apache.ambari.server.serveraction.upgrades.ComponentVersionCheckAction"
 />
       </execute-stage>
@@ -407,12 +407,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -457,9 +451,9 @@
           <task xsi:type="configure" id="hdp_2_3_0_0_update_ranger_admin"/>
 
           <task xsi:type="server_action" summary="Calculating Ranger 
Properties" 
class="org.apache.ambari.server.serveraction.upgrades.RangerConfigCalculation"/>
-          
+
           <task xsi:type="configure" id="hdp_2_3_0_0_update_ranger_usersync"/>
-            
+
           <task xsi:type="configure" id="hdp_2_3_0_0_update_ranger_site"/>
 
           <task xsi:type="configure" 
id="hdp_2_3_0_0_update_ranger_usersync_sync_source"/>
@@ -517,9 +511,9 @@
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hdfs_transition_ranger_hdfs_policy"/>
 
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hdfs_transition_ranger_hdfs_audit"/>
-          
+
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hdfs_transition_ranger_hdfs_security"/>
-          
+
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hdfs_ranger_hdfs_delete_old_properties"/>
         </pre-upgrade>
 
@@ -578,19 +572,19 @@
 
     <service name="YARN">
       <component name="APP_TIMELINE_SERVER">
-        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_yarn_ats_enable_recovery"/>
           <task xsi:type="configure" id="hdp_2_3_0_0_yarn_keep_ats_v1"/>
         </pre-upgrade>
 
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
+
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>
       </component>
 
       <component name="RESOURCEMANAGER">
-        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_yarn_rm_disable_node_labels"/>
 
@@ -601,6 +595,9 @@
           <task xsi:type="configure" 
id="hdp_2_3_0_0_yarn_rm_check_cs_root_max_capacity"/>
 
         </pre-upgrade>
+
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
+
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>
@@ -647,6 +644,7 @@
           <task xsi:type="configure" 
id="hdp_2_3_4_0_hbase_remove_local_indexing"/>
         </pre-upgrade>
 
+
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>
@@ -705,12 +703,6 @@
 
       <component name="HIVE_SERVER">
         <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_set_transport_mode"/>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_replace_auth_manager"/>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_configure_authentication"/>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_configure_ranger_policy"/>
@@ -720,14 +712,7 @@
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_remove_datastore_classname"/>
         </pre-upgrade>
 
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_restore_transport_mode_on_downgrade"/>
-        </pre-downgrade>
+        <pre-downgrade/>
 
         <upgrade>
           <task xsi:type="restart-task"/>
@@ -857,7 +842,6 @@
 
     <service name="KNOX">
       <component name="KNOX_GATEWAY">
-        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_knox_configure_ranger_policy"/>
 
@@ -865,6 +849,9 @@
 
           <task xsi:type="configure" 
id="hdp_2_3_0_0_knox_remove_deprecated_ranger_properties"/>
         </pre-upgrade>
+
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
+
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>
@@ -903,7 +890,7 @@
           <task xsi:type="configure" 
id="hdp_2_3_0_0_nimbus_monitor_freq_adjustment"/>
 
           <task xsi:type="configure" 
id="hdp_2_3_0_0_nimbus_convert_nimbus_host_to_seeds"/>
-          
+
           <task xsi:type="configure" id="hdp_2_3_0_0_update_storm_env"/>
 
           <task xsi:type="configure" id="hdp_2_3_0_0_nimbus_update_env_vars"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
index 4a704ad..a614a8e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
@@ -395,7 +395,7 @@
 
     <group xsi:type="cluster" name="FINALIZE_PRE_CHECK" title="Finalize 
{{direction.text.proper}} Pre-Check">
       <direction>UPGRADE</direction>
-      
+
       <execute-stage title="Check Component Versions">
         <task xsi:type="server_action" 
class="org.apache.ambari.server.serveraction.upgrades.ComponentVersionCheckAction"
 />
       </execute-stage>
@@ -412,12 +412,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -461,9 +455,9 @@
           <task xsi:type="configure" id="hdp_2_3_0_0_update_ranger_admin"/>
 
           <task xsi:type="server_action" summary="Calculating Ranger 
Properties" 
class="org.apache.ambari.server.serveraction.upgrades.RangerConfigCalculation"/>
-          
+
           <task xsi:type="configure" id="hdp_2_3_0_0_update_ranger_usersync"/>
-            
+
           <task xsi:type="configure" id="hdp_2_3_0_0_update_ranger_site"/>
 
           <task xsi:type="configure" 
id="hdp_2_3_0_0_update_ranger_usersync_sync_source"/>
@@ -594,7 +588,6 @@
       </component>
 
       <component name="RESOURCEMANAGER">
-        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_yarn_rm_disable_node_labels"/>
 
@@ -606,6 +599,9 @@
 
           <task xsi:type="server_action" summary="Calculating Yarn Properties 
for Spark Shuffle" 
class="org.apache.ambari.server.serveraction.upgrades.SparkShufflePropertyConfig"
 />
         </pre-upgrade>
+
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
+
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>
@@ -684,6 +680,7 @@
 
           <task xsi:type="server_action" summary="Verifying LZO codec path for 
Tez" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath"/>
         </pre-upgrade>
+
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>
@@ -715,12 +712,6 @@
 
       <component name="HIVE_SERVER">
         <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_set_transport_mode"/>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_replace_auth_manager"/>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_configure_authentication"/>
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_configure_ranger_policy"/>
@@ -730,14 +721,7 @@
           <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_remove_datastore_classname"/>
         </pre-upgrade>
 
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_restore_transport_mode_on_downgrade"/>
-        </pre-downgrade>
+        <pre-downgrade/>
 
         <upgrade>
           <task xsi:type="restart-task"/>
@@ -915,7 +899,7 @@
           <task xsi:type="configure" 
id="hdp_2_3_0_0_nimbus_monitor_freq_adjustment"/>
 
           <task xsi:type="configure" 
id="hdp_2_3_0_0_nimbus_convert_nimbus_host_to_seeds"/>
-          
+
           <task xsi:type="configure" id="hdp_2_3_0_0_update_storm_env"/>
 
           <task xsi:type="configure" id="hdp_2_3_0_0_nimbus_update_env_vars"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
index 6105665..e8a2e2f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
@@ -118,57 +118,6 @@
     <service name="HIVE">
       <component name="HIVE_SERVER">
         <changes>
-          <definition xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_set_transport_mode">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10010</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10011</value>
-            </condition>
-          </definition>
-          <definition xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_restore_transport_mode_on_downgrade">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10000</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10001</value>
-            </condition>
-          </definition>
-
-          <definition xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_set_transport_mode">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10010</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10011</value>
-            </condition>
-          </definition>
-
-          <definition xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_restore_transport_mode_on_downgrade">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10000</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10001</value>
-            </condition>
-          </definition>
-
           <definition xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_configure_authentication" summary="Removing unused 
properties for current hive authentication type">
             <type>hive-site</type>
             <transfer operation="delete" 
delete-key="hive.server2.authentication.ldap.url" 
if-key="hive.server2.authentication" if-type="hive-site" if-value="NONE"/>
@@ -220,32 +169,6 @@
             <transfer operation="delete" 
delete-key="atlas.hook.hive.maxThreads" />
           </definition>
 
-          <definition xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_set_transport_mode">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10010</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10011</value>
-            </condition>
-          </definition>
-
-          <definition xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_restore_transport_mode_on_downgrade">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10000</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10001</value>
-            </condition>
-          </definition>
-
         </changes>
       </component>
       <component name="WEBHCAT_SERVER">

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/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 533a1e9..52ba186 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
@@ -410,12 +410,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -697,24 +691,6 @@
       </component>
 
       <component name="HIVE_SERVER">
-        <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_set_transport_mode"/>
-        </pre-upgrade>
-
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_3_0_0_hive_server_restore_transport_mode_on_downgrade"/>
-        </pre-downgrade>
-
         <upgrade>
           <task xsi:type="restart-task"/>
         </upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
index 5ac0540..004e3d7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
@@ -453,12 +453,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -720,23 +714,10 @@
 
       <component name="HIVE_SERVER">
         <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_set_transport_mode"/>
           <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_configure_authentication"/>
         </pre-upgrade>
 
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_restore_transport_mode_on_downgrade"/>
-        </pre-downgrade>
+        <pre-downgrade/>
 
         <upgrade>
           <task xsi:type="restart-task" />

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
index 46e11e4..cbd41a6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
@@ -509,12 +509,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="RANGER" component="RANGER_ADMIN" title="Ranger 
Kerberos Keytab Check">
         <task xsi:type="server_action" 
class="org.apache.ambari.server.serveraction.upgrades.KerberosKeytabsAction">
           <summary>Ranger Kerberos Keytab Check</summary>
@@ -817,12 +811,6 @@
 
       <component name="HIVE_SERVER">
         <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_set_transport_mode"/>
           <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_configure_authentication"/>
           <task xsi:type="configure" 
id="hdp_2_5_0_0_remove_ranger_hive_audit_db" />
 
@@ -832,14 +820,7 @@
           <task xsi:type="server_action" summary="Update hive-env content" 
class="org.apache.ambari.server.serveraction.upgrades.HiveEnvClasspathAction"/>
         </pre-upgrade>
 
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_restore_transport_mode_on_downgrade"/>
-        </pre-downgrade>
+        <pre-downgrade/>
 
         <upgrade>
           <task xsi:type="restart-task" />

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
index db59f8c..e127dff 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
@@ -66,32 +66,6 @@
     <service name="HIVE">
       <component name="HIVE_SERVER">
         <changes>
-          <definition xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_set_transport_mode">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10010</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10011</value>
-            </condition>
-          </definition>
-
-          <definition xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_restore_transport_mode_on_downgrade">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10000</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10001</value>
-            </condition>
-          </definition>
-
           <definition xsi:type="configure" 
id="hdp_2_5_0_0_remove_ranger_hive_audit_db">
             <type>ranger-hive-audit</type>
             <transfer operation="delete" 
delete-key="xasecure.audit.destination.db" />

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
index abf2db3..f68dc4b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
@@ -407,12 +407,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -672,24 +666,6 @@
       </component>
 
       <component name="HIVE_SERVER">
-        <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_set_transport_mode"/>
-        </pre-upgrade>
-
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_restore_transport_mode_on_downgrade" />
-        </pre-downgrade>
-
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
index 8a7f0fa..b009995 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
@@ -504,12 +504,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -816,22 +810,9 @@
           <task xsi:type="configure" 
id="hdp_2_5_0_0_remove_ranger_hive_audit_db" />
           <task xsi:type="server_action" summary="Update hive-env content" 
class="org.apache.ambari.server.serveraction.upgrades.HiveEnvClasspathAction"/>
 
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_set_transport_mode"/>
         </pre-upgrade>
 
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_4_0_0_hive_server_restore_transport_mode_on_downgrade" />
-        </pre-downgrade>
+        <pre-downgrade/>
 
         <upgrade>
           <task xsi:type="restart-task" />

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
index 962d92e..065f30f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
@@ -19,37 +19,6 @@
 <upgrade-config-changes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 
   <services>
-    <service name="HIVE">
-      <component name="HIVE_SERVER">
-        <changes>
-          <definition xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_set_transport_mode">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10010</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10011</value>
-            </condition>
-          </definition>
-
-          <definition xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_restore_transport_mode_on_downgrade">
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="binary">
-              <type>hive-site</type>
-              <key>hive.server2.thrift.port</key>
-              <value>10000</value>
-            </condition>
-            <condition type="hive-site" key="hive.server2.transport.mode" 
value="http">
-              <type>hive-site</type>
-              <key>hive.server2.http.port</key>
-              <value>10001</value>
-            </condition>
-          </definition>
-        </changes>
-      </component>
-    </service>
     <service name="STORM">
       <component name="NIMBUS">
         <changes>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
index a3f655e..da32ae3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
@@ -454,12 +454,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Hive Server 
Port Change">
-        <task xsi:type="manual">
-          <message>If there are users or applications using URLS that specify 
the Hive Server port number, they will now fail to connect. You can restore the 
port back to its original value after the upgrade has been finalized.</message>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HDFS" component="NAMENODE" title="Execute HDFS 
Finalize">
         <task xsi:type="execute" hosts="master">
           <script>scripts/namenode.py</script>
@@ -723,24 +717,6 @@
       </component>
 
       <component name="HIVE_SERVER">
-        <pre-upgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10010 if Hive is using a binary transfer mode or 10011 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1001[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_set_transport_mode"/>
-        </pre-upgrade>
-
-        <pre-downgrade>
-          <task xsi:type="manual">
-            <summary>HiveServer Port Availability</summary>
-            <message>Please note that the HiveServer port will now change to 
10000 if Hive is using a binary transfer mode or 10001 if Hive is using an http 
transport mode. You can use "netstat -anp | grep 1000[01]" to determine if the 
port is available on each of following HiveServer host(s): {{hosts.all}}. If 
the port is not available, the process using it must be terminated.</message>
-          </task>
-
-          <task xsi:type="configure" 
id="hdp_2_5_0_0_hive_server_restore_transport_mode_on_downgrade" />
-        </pre-downgrade>
-
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveNotRollingWarningTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveNotRollingWarningTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveNotRollingWarningTest.java
new file mode 100644
index 0000000..665d6ec
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveNotRollingWarningTest.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Service;
+import org.apache.ambari.server.state.StackId;
+import org.apache.ambari.server.state.stack.PrereqCheckStatus;
+import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+import org.easymock.EasyMock;
+import org.easymock.EasyMockSupport;
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.google.inject.Provider;
+
+/**
+ * Tests {@link HiveNotRollingWarning}.
+ */
+public class HiveNotRollingWarningTest extends EasyMockSupport {
+
+  private final String m_clusterName = "c1";
+  private final Clusters m_clusters = niceMock(Clusters.class);
+
+  /**
+   * @throws Exception
+   */
+  @Test
+  public void testIsApplicable() throws Exception {
+    final HiveNotRollingWarning hiveWarningCheck = new HiveNotRollingWarning();
+    hiveWarningCheck.clustersProvider = new Provider<Clusters>() {
+
+      @Override
+      public Clusters get() {
+        return m_clusters;
+      }
+    };
+
+    final Cluster cluster = niceMock(Cluster.class);
+    final Service hive = niceMock(Service.class);
+
+    final Map<String, Service> services = new HashMap<>();
+    services.put("HIVE", hive);
+
+    EasyMock.expect(cluster.getClusterId()).andReturn(1L).anyTimes();
+
+    EasyMock.expect(cluster.getCurrentStackVersion()).andReturn(new 
StackId("HDP", "2.3")).anyTimes();
+    EasyMock.expect(cluster.getServices()).andReturn(services).atLeastOnce();
+    
EasyMock.expect(m_clusters.getCluster(m_clusterName)).andReturn(cluster).atLeastOnce();
+
+    PrereqCheckRequest request = niceMock(PrereqCheckRequest.class);
+    EasyMock.expect(request.getClusterName()).andReturn(m_clusterName);
+    EasyMock.expect(request.getUpgradeType()).andReturn(UpgradeType.ROLLING);
+
+    replayAll();
+
+    Assert.assertTrue(hiveWarningCheck.isApplicable(request));
+
+    verifyAll();
+  }
+
+  /**
+   * @throws Exception
+   */
+  @Test
+  public void testPerform() throws Exception {
+    final HiveNotRollingWarning hiveWarningCheck = new HiveNotRollingWarning();
+
+    PrereqCheckRequest request = new PrereqCheckRequest(m_clusterName);
+    PrerequisiteCheck check = new PrerequisiteCheck(null, null);
+
+    hiveWarningCheck.perform(check, request);
+    Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarningTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarningTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarningTest.java
deleted file mode 100644
index cf76d12..0000000
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarningTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ambari.server.checks;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.ambari.server.controller.PrereqCheckRequest;
-import org.apache.ambari.server.state.Cluster;
-import org.apache.ambari.server.state.Clusters;
-import org.apache.ambari.server.state.Service;
-import org.apache.ambari.server.state.StackId;
-import org.apache.ambari.server.state.stack.PrereqCheckStatus;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
-import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
-import org.easymock.EasyMock;
-import org.easymock.EasyMockSupport;
-import org.junit.Assert;
-import org.junit.Test;
-
-import com.google.inject.Provider;
-
-/**
- * Tests {@link HiveRollingPortChangeWarning}.
- */
-public class HiveRollingPortChangeWarningTest extends EasyMockSupport {
-
-  private final String m_clusterName = "c1";
-  private final Clusters m_clusters = niceMock(Clusters.class);
-
-  /**
-   * @throws Exception
-   */
-  @Test
-  public void testIsApplicable() throws Exception {
-    final HiveRollingPortChangeWarning portChangeWarning = new 
HiveRollingPortChangeWarning();
-    portChangeWarning.clustersProvider = new Provider<Clusters>() {
-
-      @Override
-      public Clusters get() {
-        return m_clusters;
-      }
-    };
-
-    final Cluster cluster = niceMock(Cluster.class);
-    final Service hive = niceMock(Service.class);
-
-    final Map<String, Service> services = new HashMap<>();
-    services.put("HIVE", hive);
-
-    EasyMock.expect(cluster.getClusterId()).andReturn(1L).anyTimes();
-
-    EasyMock.expect(cluster.getCurrentStackVersion()).andReturn(new 
StackId("HDP", "2.3")).anyTimes();
-    EasyMock.expect(cluster.getServices()).andReturn(services).atLeastOnce();
-    
EasyMock.expect(m_clusters.getCluster(m_clusterName)).andReturn(cluster).atLeastOnce();
-
-    PrereqCheckRequest request = niceMock(PrereqCheckRequest.class);
-    EasyMock.expect(request.getClusterName()).andReturn(m_clusterName);
-    EasyMock.expect(request.getUpgradeType()).andReturn(UpgradeType.ROLLING);
-
-    replayAll();
-
-    Assert.assertTrue(portChangeWarning.isApplicable(request));
-
-    verifyAll();
-  }
-
-  /**
-   * @throws Exception
-   */
-  @Test
-  public void testPerform() throws Exception {
-    final HiveRollingPortChangeWarning portChangeWarning = new 
HiveRollingPortChangeWarning();
-
-    PrereqCheckRequest request = new PrereqCheckRequest(m_clusterName);
-    PrerequisiteCheck check = new PrerequisiteCheck(null, null);
-
-    portChangeWarning.perform(check, request);
-    Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae5b834/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index 9e9491f..bcd6c4b 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -772,11 +772,20 @@ From source with checksum 
150f554beae04f76f814f59549dead8b"""
      call_mocks = call_side_effects
     )
 
-    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hive-server2', '2.2.1.0-2065'), sudo=True,)
+    # ensure deregister is called
     self.assertResourceCalledIgnoreEarlier('Execute', 'hive --config 
/etc/hive/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434',
       
path=['/bin:/usr/hdp/current/hive-server2/bin:/usr/hdp/current/hadoop-client/bin'],
       tries=1, user='hive')
 
+    # ensure stop is called
+    self.assertResourceCalled('Execute', "ambari-sudo.sh kill 123",
+        not_if = "! (ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 
123 >/dev/null 2>&1)")
+
+    # skip any other stop stuff since it's covered by other tests and verify 
hdp-select
+    self.assertResourceCalledIgnoreEarlier('Execute',
+      ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hive-server2', 
'2.2.1.0-2065'),
+      sudo=True)
+
 
   @patch("resource_management.libraries.functions.copy_tarball.copy_to_hdfs")
   def test_stop_during_upgrade_with_default_conf_server(self, 
copy_to_hdfs_mock):
@@ -795,11 +804,17 @@ From source with checksum 
150f554beae04f76f814f59549dead8b"""
      call_mocks = call_side_effects
     )
 
-    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hive-server2', '2.2.1.0-2065'), sudo=True,)
+    # ensure that deregister is called
     self.assertResourceCalledIgnoreEarlier( 'Execute', 'hive --config 
/etc/hive/conf.server --service hiveserver2 --deregister 1.2.1.2.3.0.0-2434',
       
path=['/bin:/usr/hdp/current/hive-server2/bin:/usr/hdp/current/hadoop-client/bin'],
       tries=1, user='hive')
 
+    # ensure hdp-select is called
+    self.assertResourceCalledIgnoreEarlier('Execute',
+      ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hive-server2', 
'2.2.1.0-2065'),
+      sudo = True, )
+
+
   def test_stop_during_upgrade_bad_hive_version(self):
     try:
       self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/hive_server.py",
@@ -811,7 +826,13 @@ From source with checksum 
150f554beae04f76f814f59549dead8b"""
     except:
       pass
 
-    self.assertResourceCalled('Execute', ('ambari-python-wrap', 
'/usr/bin/hdp-select', 'set', 'hive-server2', '2.2.1.0-2065'), sudo=True,)
+    self.assertResourceCalled('Execute', "ambari-sudo.sh kill 123",
+        not_if = "! (ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p 
123 >/dev/null 2>&1)")
+
+    self.assertResourceCalledIgnoreEarlier('Execute',
+      ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'hive-server2', 
'2.2.1.0-2065'),
+      sudo=True)
+
     self.assertNoMoreResources()
 
   
@patch("resource_management.libraries.functions.security_commons.build_expectations")

Reply via email to