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 B727C200B3E for ; Wed, 7 Sep 2016 15:18:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B5E0B160AC1; Wed, 7 Sep 2016 13:18:50 +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 0A4A8160AA3 for ; Wed, 7 Sep 2016 15:18:49 +0200 (CEST) Received: (qmail 80949 invoked by uid 500); 7 Sep 2016 13:18:49 -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 80940 invoked by uid 99); 7 Sep 2016 13:18:49 -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; Wed, 07 Sep 2016 13:18:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 132ACDFF58; Wed, 7 Sep 2016 13:18:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stoader@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-18302.Desired state of client component should not be changed in case configuration changes are applied through a "Restart.(Laszlo Puskas via stoader)" Date: Wed, 7 Sep 2016 13:18:49 +0000 (UTC) archived-at: Wed, 07 Sep 2016 13:18:50 -0000 Repository: ambari Updated Branches: refs/heads/trunk 3461a5c7c -> 6d13be5b9 AMBARI-18302.Desired state of client component should not be changed in case configuration changes are applied through a "Restart.(Laszlo Puskas via stoader)" Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6d13be5b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6d13be5b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6d13be5b Branch: refs/heads/trunk Commit: 6d13be5b9ab6aa129bc1a71fc2eb57ccf7bbe6cd Parents: 3461a5c Author: Toader, Sebastian Authored: Wed Sep 7 15:18:25 2016 +0200 Committer: Toader, Sebastian Committed: Wed Sep 7 15:18:25 2016 +0200 ---------------------------------------------------------------------- .../AmbariCustomCommandExecutionHelper.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/6d13be5b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java index 8c8ae10..a671f0c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java @@ -465,15 +465,20 @@ public class AmbariCustomCommandExecutionHelper { private void applyCustomCommandBackendLogic(Cluster cluster, String serviceName, String componentName, String commandName, String hostname) throws AmbariException { switch (commandName) { case "RESTART": - ServiceComponentHost serviceComponentHost = cluster.getService( - serviceName).getServiceComponent(componentName).getServiceComponentHost(hostname); - + ServiceComponent serviceComponent = cluster.getService(serviceName).getServiceComponent(componentName); + ServiceComponentHost serviceComponentHost = serviceComponent.getServiceComponentHost(hostname); State currentDesiredState = serviceComponentHost.getDesiredState(); - if (currentDesiredState != State.STARTED) { - LOG.info("Updating desired state to {} on RESTART for {}/{} because it was {}", - State.STARTED, serviceName, componentName, currentDesiredState); - serviceComponentHost.setDesiredState(State.STARTED); + if( !serviceComponent.isClientComponent()) { + if (currentDesiredState != State.STARTED) { + LOG.info("Updating desired state to {} on RESTART for {}/{} because it was {}", + State.STARTED, serviceName, componentName, currentDesiredState); + + serviceComponentHost.setDesiredState(State.STARTED); + } + } else { + LOG.debug("Desired state for client components should not be updated on RESTART. Service/Component {}/{}", + serviceName, componentName); } break;