Просмотр исходного кода

AMBARI-8934. Fix event handling for Hive deployments in Blueprints. (rnettleton)

Bob Nettleton 10 лет назад
Родитель
Сommit
9c73f2cbba

+ 10 - 1
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java

@@ -98,6 +98,7 @@ import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
 import org.apache.ambari.server.state.ServiceComponentHost;
 import org.apache.ambari.server.state.ServiceComponentHostEvent;
+import org.apache.ambari.server.state.ServiceComponentHostEventType;
 import org.apache.ambari.server.state.ServiceFactory;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.StackId;
@@ -2328,7 +2329,15 @@ public class ClusterImpl implements Cluster {
           failedEvents.add(event);
         } catch (InvalidStateTransitionException e) {
           LOG.error("Invalid transition ", e);
-          failedEvents.add(event);
+          if ((e.getEvent() == ServiceComponentHostEventType.HOST_SVCCOMP_START) &&
+            (e.getCurrentState() == State.STARTED)) {
+            LOG.warn("Component request for component = " + event.getServiceComponentName() + " to start is invalid, since component is already started. Ignoring this request.");
+            // skip adding this as a failed event, to work around stack ordering issues with Hive
+          } else {
+            failedEvents.add(event);
+          }
+
+
         }
       }
     } finally {