You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2015/11/13 20:23:19 UTC

ambari git commit: AMBARI-13872: Rolling Upgrade: Configuration Groups not applied for upgrades across stack versions (jluniya)

Repository: ambari
Updated Branches:
  refs/heads/trunk 883c77f1f -> 3a84d5f4a


AMBARI-13872: Rolling Upgrade: Configuration Groups not applied for upgrades across stack versions (jluniya)


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

Branch: refs/heads/trunk
Commit: 3a84d5f4a87b8de68685fdfde242e782c9e1e07f
Parents: 883c77f
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Fri Nov 13 11:23:15 2015 -0800
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Fri Nov 13 11:23:15 2015 -0800

----------------------------------------------------------------------
 .../actionmanager/ExecutionCommandWrapper.java    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3a84d5f4/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
index 40038eb..99d61af 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
@@ -25,6 +25,8 @@ import java.util.TreeMap;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.agent.ExecutionCommand;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.AmbariServer;
 import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
@@ -86,7 +88,9 @@ public class ExecutionCommandWrapper {
           // tags to be refreshed to the latest cluster desired-configs.
           Set<String> refreshConfigTagsBeforeExecution = executionCommand.getForceRefreshConfigTagsBeforeExecution();
           if (refreshConfigTagsBeforeExecution != null && !refreshConfigTagsBeforeExecution.isEmpty()) {
-            Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs();
+            AmbariManagementController managementController = AmbariServer.getController();
+            Map<String, Map<String, String>> configTags = managementController.findConfigurationTagsWithOverrides(
+                cluster, executionCommand.getHostname());
             for (String refreshConfigTag : refreshConfigTagsBeforeExecution) {
               if ("*".equals(refreshConfigTag)) {
                 // if forcing a refresh of *, then clear out any existing
@@ -94,15 +98,11 @@ public class ExecutionCommandWrapper {
                 // forcefully applied
                 LOG.debug("ExecutionCommandWrapper.getExecutionCommand: refreshConfigTag set to {}, so clearing config for full refresh.", refreshConfigTag);
                 executionCommand.getConfigurations().clear();
-
-                for (final Entry<String, DesiredConfig> desiredConfig : desiredConfigs.entrySet()) {
-                  configurationTags.put(desiredConfig.getKey(), new HashMap<String, String>() {{
-                    put("tag", desiredConfig.getValue().getTag());
-                  }});
-                }
+                configurationTags = configTags;
+                executionCommand.setConfigurationTags(configTags);
                 break;
-              } else if (configurationTags.containsKey(refreshConfigTag) && desiredConfigs.containsKey(refreshConfigTag)) {
-                configurationTags.get(refreshConfigTag).put("tag", desiredConfigs.get(refreshConfigTag).getTag());
+              } else if (configurationTags.containsKey(refreshConfigTag) && configTags.containsKey(refreshConfigTag)) {
+                configurationTags.put(refreshConfigTag, configTags.get(refreshConfigTag));
               }
             }
           }