Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D1EFF200C18 for ; Fri, 27 Jan 2017 19:17:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D0C1B160B6C; Fri, 27 Jan 2017 18:17:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 06B60160B63 for ; Fri, 27 Jan 2017 19:17:13 +0100 (CET) Received: (qmail 18583 invoked by uid 500); 27 Jan 2017 18:17:13 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 18415 invoked by uid 99); 27 Jan 2017 18:17:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jan 2017 18:17:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C8E30DFF17; Fri, 27 Jan 2017 18:17:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ncole@apache.org To: commits@ambari.apache.org Date: Fri, 27 Jan 2017 18:17:20 -0000 Message-Id: In-Reply-To: <8d685aca65d84ca597961d961d601ed0@git.apache.org> References: <8d685aca65d84ca597961d961d601ed0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/49] ambari git commit: AMBARI-19714. Perf: start/stop all actions works much slower after few days of testing.(vbrodetskyi) archived-at: Fri, 27 Jan 2017 18:17:14 -0000 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/e3a53ba3 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e3a53ba3 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e3a53ba3 Branch: refs/heads/branch-dev-patch-upgrade Commit: e3a53ba398d675b62d5ebf8c5324fbce2f3b2f79 Parents: fda3de6 Author: Vitaly Brodetskyi Authored: Thu Jan 26 01:34:23 2017 +0200 Committer: Vitaly Brodetskyi Committed: Thu Jan 26 01:34:23 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/e3a53ba3/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 d03b2bb..2882db8 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 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 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/e3a53ba3/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