ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [49/50] [abbrv] ambari git commit: AMBARI-22605. Tez service check hangs when adding service. (mpapirkovskyy)
Date Thu, 07 Dec 2017 16:40:40 GMT
AMBARI-22605. Tez service check hangs when adding service. (mpapirkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-21674
Commit: a9c3bf56a64448708dde677d063619d4c71e3492
Parents: 2460ea1
Author: Myroslav Papirkovskyi <mpapyrkovskyy@hortonworks.com>
Authored: Wed Dec 6 18:10:53 2017 +0200
Committer: Myroslav Papirkovskyi <mpapyrkovskyy@hortonworks.com>
Committed: Thu Dec 7 17:37:33 2017 +0200

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         |  6 +++++
 .../upgrade/HostVersionOutOfSyncListener.java   | 24 ++++++++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a9c3bf56/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 232737c..198b617 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -3031,6 +3031,12 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
           continue;
         }
 
+        if (StringUtils.isBlank(stage.getHostParamsStage())) {
+          RepositoryVersionEntity repositoryVersion = component.getDesiredRepositoryVersion();
+          stage.setHostParamsStage(StageUtils.getGson().toJson(
+              customCommandExecutionHelper.createDefaultHostParams(cluster, repositoryVersion.getStackId())));
+        }
+
         customCommandExecutionHelper.addServiceCheckAction(stage, clientHost, smokeTestRole,
             nowTimestamp, serviceName, componentName, null, false, false);
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a9c3bf56/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
index 4ce855d..4b3e42a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
@@ -129,6 +129,14 @@ public class HostVersionOutOfSyncListener {
         // stack, but become versionAdvertised in some future (installed, but not yet upgraded
to) stack
         String serviceName = event.getServiceName();
         String componentName = event.getComponentName();
+
+        // Skip lookup if stack does not contain the component
+        if (!ami.get().isValidServiceComponent(hostStackId.getStackName(),
+            hostStackId.getStackVersion(), serviceName, componentName)) {
+          LOG.debug("Component not found is host stack, stack={}, version={}, service={},
component={}",
+              hostStackId.getStackName(), hostStackId.getStackVersion(), serviceName, componentName);
+          continue;
+        }
         ComponentInfo component = ami.get().getComponent(hostStackId.getStackName(),
                 hostStackId.getStackVersion(), serviceName, componentName);
 
@@ -215,6 +223,14 @@ public class HostVersionOutOfSyncListener {
     Collection<HostComponentDesiredStateEntity> hostComponents = host.getHostComponentDesiredStateEntities();
 
     for (HostComponentDesiredStateEntity hostComponent : hostComponents) {
+      // Skip lookup if stack does not contain the component
+      if (!ami.get().isValidServiceComponent(stackId.getStackName(),
+          stackId.getStackVersion(), hostComponent.getServiceName(), hostComponent.getComponentName()))
{
+        LOG.debug("Component not found is host stack, stack={}, version={}, service={}, component={}",
+            stackId.getStackName(), stackId.getStackVersion(),
+            hostComponent.getServiceName(), hostComponent.getComponentName());
+        continue;
+      }
       ComponentInfo ci = ami.get().getComponent(stackId.getStackName(), stackId.getStackVersion(),
           hostComponent.getServiceName(), hostComponent.getComponentName());
 
@@ -260,6 +276,14 @@ public class HostVersionOutOfSyncListener {
           String serviceName = event.getServiceName();
           for (ServiceComponent comp : affectedHosts.get(hostName)) {
             String componentName = comp.getName();
+
+            // Skip lookup if stack does not contain the component
+            if (!ami.get().isValidServiceComponent(repositoryVersion.getStackName(),
+                repositoryVersion.getStackVersion(), serviceName, componentName)) {
+              LOG.debug("Component not found is host stack, stack={}, version={}, service={},
component={}",
+                  repositoryVersion.getStackName(), repositoryVersion.getStackVersion(),
serviceName, componentName);
+              continue;
+            }
             ComponentInfo component = ami.get().getComponent(repositoryVersion.getStackName(),
                     repositoryVersion.getStackVersion(), serviceName, componentName);
             if (component.isVersionAdvertised()) {


Mime
View raw message