You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2017/01/25 23:33:13 UTC

ambari git commit: AMBARI-19714. Perf: start/stop all actions works much slower after few days of testing.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 66a2518cb -> dd8848deb


AMBARI-19714. Perf: start/stop all actions works much slower after few days of testing.(vbrodetskyi)


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

Branch: refs/heads/branch-2.5
Commit: dd8848deb3dc886949dd28887110a84de06e47ed
Parents: 66a2518
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Thu Jan 26 01:32:13 2017 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Thu Jan 26 01:32:13 2017 +0200

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         | 23 +++++++++++++-------
 contrib/utils/perf/deploy-gce-perf-cluster.py   |  4 ++--
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dd8848de/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 c1f7943..cb4fdbe 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
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.server.controller;
 
+import javax.persistence.RollbackException;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_DRIVER;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_PASSWORD;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_URL;
@@ -64,8 +65,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 
-import javax.persistence.RollbackException;
-
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ClusterNotFoundException;
 import org.apache.ambari.server.DuplicateResourceException;
@@ -2186,7 +2185,9 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
                                 RoleCommand roleCommand,
                                 Map<String, String> commandParamsInp,
                                 ServiceComponentHostEvent event,
-                                boolean skipFailure
+                                boolean skipFailure,
+                                ClusterVersionEntity effectiveClusterVersion,
+                                boolean isUpgradeSuspended
                                 )
                                 throws AmbariException {
 
@@ -2302,7 +2303,6 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         commandParams.put(MAX_DURATION_OF_RETRIES, Integer.toString(retryMaxTime));
         commandParams.put(COMMAND_RETRY_ENABLED, Boolean.toString(retryEnabled));
 
-        ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
         if (effectiveClusterVersion != null) {
          commandParams.put(VERSION, effectiveClusterVersion.getRepositoryVersion().getVersion());
         }
@@ -2360,7 +2360,6 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     // in the context of an upgrade and we should send the repo ID which matches
     // the version being send down
     RepositoryVersionEntity repoVersion = null;
-    ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
     if (null != effectiveClusterVersion) {
       repoVersion = effectiveClusterVersion.getRepositoryVersion();
     } else {
@@ -2426,7 +2425,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     // !!! consistent with where custom commands put variables
     // !!! after-INSTALL hook checks this such that the stack selection tool won't
     // select-all to a version that is not being upgraded, breaking RU
-    if (cluster.isUpgradeSuspended()) {
+    if (isUpgradeSuspended) {
       cluster.addSuspendedUpgradeParameters(commandParams, roleParams);
     }
 
@@ -2561,6 +2560,12 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
       return requestStages;
     }
 
+    // caching effective cluster version
+    ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
+
+    // caching upgrade suspended
+    boolean isUpgradeSuspended = cluster.isUpgradeSuspended();
+
     // smoke test any service that goes from installed to started
     Set<String> smokeTestServices = getServicesForSmokeTests(cluster,
       changedServices, changedScHosts, runSmokeTest);
@@ -2893,7 +2898,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
               scHost.setState(State.INSTALLED);
             } else {
               createHostAction(cluster, stage, scHost, configurations, configurationAttributes, configTags,
-                roleCommand, requestParameters, event, skipFailure);
+                roleCommand, requestParameters, event, skipFailure, effectiveClusterVersion, isUpgradeSuspended);
             }
 
           }
@@ -3029,8 +3034,10 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         configurationAttributes =
         new TreeMap<>();
 
+    ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
+    boolean isUpgradeSuspended = cluster.isUpgradeSuspended();
     createHostAction(cluster, stage, scHost, configurations, configurationAttributes, configTags,
-                     roleCommand, null, null, false);
+                     roleCommand, null, null, false, effectiveClusterVersion, isUpgradeSuspended);
     ExecutionCommand ec = stage.getExecutionCommands().get(scHost.getHostName()).get(0).getExecutionCommand();
 
     // createHostAction does not take a hostLevelParams but creates one

http://git-wip-us.apache.org/repos/asf/ambari/blob/dd8848de/contrib/utils/perf/deploy-gce-perf-cluster.py
----------------------------------------------------------------------
diff --git a/contrib/utils/perf/deploy-gce-perf-cluster.py b/contrib/utils/perf/deploy-gce-perf-cluster.py
index 565a36d..7e84c40 100644
--- a/contrib/utils/perf/deploy-gce-perf-cluster.py
+++ b/contrib/utils/perf/deploy-gce-perf-cluster.py
@@ -280,13 +280,13 @@ def create_vms(args, number_of_nodes):
   :param number_of_nodes: Number of VMs to request.
   """
   print "Creating server VM {0}-server-{1} with xxlarge nodes on centos6...".format(cluster_prefix, args.cluster_suffix)
-  execute_command(args, args.controller, "/usr/sbin/gce up {0}-server-{1} 1 --centos6 --xxlarge --ex --disk-xxlarge".format(cluster_prefix, args.cluster_suffix),
+  execute_command(args, args.controller, "/usr/sbin/gce up {0}-server-{1} 1 --centos6 --xxlarge --ex --disk-xxlarge --ssd".format(cluster_prefix, args.cluster_suffix),
                   "Failed to create server, probably not enough resources!", "-tt")
   time.sleep(10)
 
   # trying to create cluster with needed params
   print "Creating agent VMs {0}-agent-{1} with {2} xlarge nodes on centos6...".format(cluster_prefix, args.cluster_suffix, str(number_of_nodes))
-  execute_command(args, args.controller, "/usr/sbin/gce up {0}-agent-{1} {2} --centos6 --xlarge --ex --disk-large".format(cluster_prefix, args.cluster_suffix, str(number_of_nodes)),
+  execute_command(args, args.controller, "/usr/sbin/gce up {0}-agent-{1} {2} --centos6 --xlarge --ex --disk-xlarge".format(cluster_prefix, args.cluster_suffix, str(number_of_nodes)),
                   "Failed to create cluster VMs, probably not enough resources!", "-tt")
 
   # VMs are not accessible immediately