ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-18822. Upgrade from 2.4.2 to 2.5 fails with DB consistency check.(vbrodetskyi)
Date Tue, 08 Nov 2016 19:45:42 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8281cc140 -> bc9f89eac


AMBARI-18822. Upgrade from 2.4.2 to 2.5 fails with DB consistency check.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: bc9f89eac29385b57099f03c50b757dcebd55d55
Parents: 8281cc1
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Tue Nov 8 05:51:20 2016 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Tue Nov 8 05:56:22 2016 +0200

----------------------------------------------------------------------
 .../apache/ambari/server/upgrade/UpgradeCatalog250.java  |  4 ++--
 .../ambari/server/upgrade/UpgradeCatalog250Test.java     | 11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bc9f89ea/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index fa7121c..3425dd7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -27,9 +27,8 @@ import java.util.Map;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.CommandExecutionType;
 import org.apache.ambari.server.controller.AmbariManagementController;
-import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
 import org.apache.ambari.server.orm.DBAccessor;
-
+import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
 import org.apache.ambari.server.orm.dao.DaoUtils;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
@@ -129,6 +128,7 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
    */
   @Override
   protected void executeDMLUpdates() throws AmbariException, SQLException {
+    addNewConfigurationsFromXml();
     updateAMSConfigs();
     updateKafkaConfigs();
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/bc9f89ea/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index 6d2011b..8ed81df 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -18,6 +18,8 @@
 
 package org.apache.ambari.server.upgrade;
 
+import javax.persistence.EntityManager;
+import junit.framework.Assert;
 import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.anyString;
 import static org.easymock.EasyMock.capture;
@@ -41,8 +43,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.persistence.EntityManager;
-
 import org.apache.ambari.server.actionmanager.ActionManager;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariManagementController;
@@ -69,8 +69,6 @@ import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.Provider;
 
-import junit.framework.Assert;
-
 /**
  * {@link UpgradeCatalog250} unit tests.
  */
@@ -199,16 +197,21 @@ public class UpgradeCatalog250Test {
   @Test
   public void testExecuteDMLUpdates() throws Exception {
     Method updateAmsConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateAMSConfigs");
+    Method addNewConfigurationsFromXml = AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
     Method updateKafkaConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateKafkaConfigs");
 
     UpgradeCatalog250 upgradeCatalog250 = createMockBuilder(UpgradeCatalog250.class)
         .addMockedMethod(updateAmsConfigs)
+        .addMockedMethod(addNewConfigurationsFromXml)
         .addMockedMethod(updateKafkaConfigs)
         .createMock();
 
     upgradeCatalog250.updateAMSConfigs();
     expectLastCall().once();
 
+    upgradeCatalog250.addNewConfigurationsFromXml();
+    expectLastCall().once();
+
     upgradeCatalog250.updateKafkaConfigs();
     expectLastCall().once();
 


Mime
View raw message