Browse Source

AMBARI-25558. Upgrade fails because host is out of sync (#3227)

* AMBARI-25558. HDP 7.1.4 upgrade failure due to ArrayIndexOutOfBoundsException on RHEL7 Oracle 12  (aonishuk)
aonishuk 5 years ago
parent
commit
36e5735bfa

+ 8 - 2
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java

@@ -137,8 +137,14 @@ public class HostVersionOutOfSyncListener {
               hostStackId.getStackName(), hostStackId.getStackVersion(), serviceName, componentName);
           continue;
         }
-        ComponentInfo component = ami.get().getComponent(hostStackId.getStackName(),
-                hostStackId.getStackVersion(), serviceName, componentName);
+
+        ComponentInfo component = ami.get().getService(hostStackId.getStackName(), hostStackId.getStackVersion(),
+                                                        serviceName).getComponentByName(componentName);
+
+        // Skip lookup if stack does not contain the component
+        if (component == null) {
+          continue;
+        }
 
         if (!component.isVersionAdvertised()) {
           RepositoryVersionState state = checkAllHostComponents(hostStackId, hostVersionEntity.getHostEntity());