Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 a0693e001 -> 551958219


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/55195821
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/55195821
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/55195821

Branch: refs/heads/branch-2.5
Commit: 551958219f170e31f951aaf8fffbeecf37ed0b18
Parents: a0693e0
Author: Toader, Sebastian <stoa...@hortonworks.com>
Authored: Wed Sep 7 15:18:25 2016 +0200
Committer: Toader, Sebastian <stoa...@hortonworks.com>
Committed: Mon Oct 10 17:13:33 2016 +0200

----------------------------------------------------------------------
 .../AmbariCustomCommandExecutionHelper.java      | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/55195821/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;

Reply via email to