ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject [1/2] ambari git commit: AMBARI-18008 RU Downgrade failure while downgrading from 2.5 to 2.3 (dlysnichenko)
Date Fri, 05 Aug 2016 09:05:23 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 aaf267b11 -> d66306866
  refs/heads/trunk 851a5d2e0 -> d4a9a635c


AMBARI-18008 RU Downgrade failure while downgrading from 2.5 to 2.3  (dlysnichenko)


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

Branch: refs/heads/branch-2.4
Commit: d663068669dfd57ac8e7aaaf561d13c8e5091907
Parents: aaf267b
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Fri Aug 5 12:03:33 2016 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Fri Aug 5 12:03:33 2016 +0300

----------------------------------------------------------------------
 .../serveraction/upgrades/ConfigureAction.java  | 32 +++++++++++---------
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml     |  2 ++
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml     |  2 ++
 3 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6630686/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
index ab6614d..5459ddb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
@@ -17,10 +17,16 @@
  */
 package org.apache.ambari.server.serveraction.upgrades;
 
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentMap;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.agent.CommandReport;
@@ -50,15 +56,10 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
 
 /**
  * The {@link ConfigureAction} is used to alter a configuration property during
@@ -236,9 +237,12 @@ public class ConfigureAction extends AbstractServerAction {
 
     Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs();
     DesiredConfig desiredConfig = desiredConfigs.get(configType);
+    if (desiredConfig == null) {
+      throw new AmbariException("Could not find desired config type with name " + configType);
+    }
     Config config = cluster.getConfig(configType, desiredConfig.getTag());
     if (config == null) {
-      throw new AmbariException("Could not find desired config type with name " + configType);
+      throw new AmbariException("Could not find config type with name " + configType);
     }
 
     StackId currentStack = cluster.getCurrentStackVersion();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6630686/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
index cf0be76..c4f7a4e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
@@ -794,6 +794,8 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_add_sqoop_atlas_security_configs"
/>
         </pre-upgrade>
 
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
+
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6630686/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
index e7bf162..5eec929 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
@@ -785,6 +785,8 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_add_sqoop_atlas_security_configs"
/>
         </pre-upgrade>
 
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
+
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>


Mime
View raw message