Browse Source

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

Jonathan Hurley 9 năm trước cách đây
mục cha
commit
4ae5b834d3
19 tập tin đã thay đổi với 93 bổ sung434 xóa
  1. 3 3
      ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
  2. 12 7
      ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
  3. 12 15
      ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server.py
  4. 7 3
      ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_upgrade.py
  5. 0 52
      ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/config-upgrade.xml
  6. 0 24
      ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.2.xml
  7. 16 29
      ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
  8. 9 25
      ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
  9. 0 77
      ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
  10. 0 24
      ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
  11. 1 20
      ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
  12. 1 20
      ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
  13. 0 26
      ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
  14. 0 24
      ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
  15. 1 20
      ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
  16. 0 31
      ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
  17. 0 24
      ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.5.xml
  18. 7 7
      ambari-server/src/test/java/org/apache/ambari/server/checks/HiveNotRollingWarningTest.java
  19. 24 3
      ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py

+ 3 - 3
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,

+ 12 - 7
ambari-server/src/main/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarning.java → ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java

@@ -28,21 +28,26 @@ 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
+ * 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 the port for Hive must change in order to preserve the uptime of
- * the service.
+ * 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 HiveRollingPortChangeWarning extends AbstractCheckDescriptor {
+public class HiveNotRollingWarning extends AbstractCheckDescriptor {
 
   /**
    * Constructor.
    */
-  public HiveRollingPortChangeWarning() {
-    super(CheckDescription.SERVICES_HIVE_ROLLING_PORT_WARNING);
+  public HiveNotRollingWarning() {
+    super(CheckDescription.SERVICES_HIVE_ROLLING_WARNING);
   }
 
   /**

+ 12 - 15
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):

+ 7 - 3
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:
   """

+ 0 - 52
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"/>

+ 0 - 24
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>

+ 16 - 29
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"/>

+ 9 - 25
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"/>

+ 0 - 77
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">

+ 0 - 24
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>

+ 1 - 20
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" />

+ 1 - 20
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" />

+ 0 - 26
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" />

+ 0 - 24
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>

+ 1 - 20
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" />

+ 0 - 31
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>

+ 0 - 24
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>

+ 7 - 7
ambari-server/src/test/java/org/apache/ambari/server/checks/HiveRollingPortChangeWarningTest.java → ambari-server/src/test/java/org/apache/ambari/server/checks/HiveNotRollingWarningTest.java

@@ -36,9 +36,9 @@ import org.junit.Test;
 import com.google.inject.Provider;
 
 /**
- * Tests {@link HiveRollingPortChangeWarning}.
+ * Tests {@link HiveNotRollingWarning}.
  */
-public class HiveRollingPortChangeWarningTest extends EasyMockSupport {
+public class HiveNotRollingWarningTest extends EasyMockSupport {
 
   private final String m_clusterName = "c1";
   private final Clusters m_clusters = niceMock(Clusters.class);
@@ -48,8 +48,8 @@ public class HiveRollingPortChangeWarningTest extends EasyMockSupport {
    */
   @Test
   public void testIsApplicable() throws Exception {
-    final HiveRollingPortChangeWarning portChangeWarning = new HiveRollingPortChangeWarning();
-    portChangeWarning.clustersProvider = new Provider<Clusters>() {
+    final HiveNotRollingWarning hiveWarningCheck = new HiveNotRollingWarning();
+    hiveWarningCheck.clustersProvider = new Provider<Clusters>() {
 
       @Override
       public Clusters get() {
@@ -75,7 +75,7 @@ public class HiveRollingPortChangeWarningTest extends EasyMockSupport {
 
     replayAll();
 
-    Assert.assertTrue(portChangeWarning.isApplicable(request));
+    Assert.assertTrue(hiveWarningCheck.isApplicable(request));
 
     verifyAll();
   }
@@ -85,12 +85,12 @@ public class HiveRollingPortChangeWarningTest extends EasyMockSupport {
    */
   @Test
   public void testPerform() throws Exception {
-    final HiveRollingPortChangeWarning portChangeWarning = new HiveRollingPortChangeWarning();
+    final HiveNotRollingWarning hiveWarningCheck = new HiveNotRollingWarning();
 
     PrereqCheckRequest request = new PrereqCheckRequest(m_clusterName);
     PrerequisiteCheck check = new PrerequisiteCheck(null, null);
 
-    portChangeWarning.perform(check, request);
+    hiveWarningCheck.perform(check, request);
     Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
   }
 }

+ 24 - 3
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")