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-18757. DB configs consistency check failed after upgrade from 2.1.1 to 2.4.2 (stack 2.3).(vbrodetskyi)
Date Tue, 01 Nov 2016 13:09:42 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 2a1a648be -> 6f5d21414


AMBARI-18757. DB configs consistency check failed after upgrade from 2.1.1 to 2.4.2 (stack
2.3).(vbrodetskyi)


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

Branch: refs/heads/branch-2.5
Commit: 6f5d214147a23eaa5e183877d9f5c3f1108e00ab
Parents: 2a1a648
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Tue Nov 1 01:55:15 2016 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Tue Nov 1 01:55:15 2016 +0200

----------------------------------------------------------------------
 .../ambari/server/upgrade/UpgradeCatalog242.java       | 13 +++++++++----
 .../ambari/server/upgrade/UpgradeCatalog242Test.java   |  4 ++--
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6f5d2141/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog242.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog242.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog242.java
index 3f024fd..541f4da 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog242.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog242.java
@@ -55,6 +55,8 @@ public class UpgradeCatalog242 extends AbstractUpgradeCatalog {
   protected static final String HOST_GROUP_TABLE = "hostgroup";
   protected static final String BLUEPRINT_CONFIGURATION = "blueprint_configuration";
   protected static final String BLUEPRINT_SETTING = "blueprint_setting";
+  protected static final String HOSTGROUP_COMPONENT = "hostgroup_component";
+  protected static final String HOSTGROUP_CONFIGURATION = "hostgroup_configuration";
 
   protected static final String BLUEPRINT_NAME_COLUMN = "blueprint_name";
   protected static final String EXTENSION_NAME_COLUMN = "extension_name";
@@ -63,6 +65,7 @@ public class UpgradeCatalog242 extends AbstractUpgradeCatalog {
   protected static final String USER_NAME_COLUMN = "user_name";
   protected static final String ROLE_COLUMN = "role";
   protected static final String STATUS_COLUMN = "status";
+  protected static final String NAME_COLUMN = "name";
 
 
   /**
@@ -139,20 +142,22 @@ public class UpgradeCatalog242 extends AbstractUpgradeCatalog {
 
       dbAccessor.dropFKConstraint(BLUEPRINT_CONFIGURATION, "FK_cfg_blueprint_name");
 
+      dbAccessor.dropFKConstraint(BLUEPRINT_CONFIGURATION, "FK_blueprint_configuration_blueprint_name");
+
       dbAccessor.dropFKConstraint(BLUEPRINT_SETTING, "FK_blueprint_setting_name");
 
       dbAccessor.alterColumn(BLUEPRINT_TABLE, new DBAccessor.DBColumnInfo(BLUEPRINT_NAME_COLUMN,
String.class, 100, null, false));
 
-      String[] uniqueColumns = new String[] { BLUEPRINT_NAME_COLUMN };
+      String[] uniqueColumns1 = new String[] { BLUEPRINT_NAME_COLUMN };
 
       dbAccessor.addFKConstraint(HOST_GROUP_TABLE, "FK_hg_blueprint_name",
-              uniqueColumns, BLUEPRINT_TABLE, uniqueColumns, false);
+              uniqueColumns1, BLUEPRINT_TABLE, uniqueColumns1, false);
 
       dbAccessor.addFKConstraint(BLUEPRINT_CONFIGURATION, "FK_cfg_blueprint_name",
-              uniqueColumns, BLUEPRINT_TABLE, uniqueColumns, false);
+              uniqueColumns1, BLUEPRINT_TABLE, uniqueColumns1, false);
 
       dbAccessor.addFKConstraint(BLUEPRINT_SETTING, "FK_blueprint_setting_name",
-              uniqueColumns, BLUEPRINT_TABLE, uniqueColumns, false);
+              uniqueColumns1, BLUEPRINT_TABLE, uniqueColumns1, false);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f5d2141/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog242Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog242Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog242Test.java
index 5e1967b..d44ae88 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog242Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog242Test.java
@@ -20,9 +20,8 @@ package org.apache.ambari.server.upgrade;
 
 import javax.persistence.EntityManager;
 import junit.framework.Assert;
-import static org.easymock.EasyMock.aryEq;
-
 import static org.easymock.EasyMock.anyString;
+import static org.easymock.EasyMock.aryEq;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.createMockBuilder;
 import static org.easymock.EasyMock.createNiceMock;
@@ -146,6 +145,7 @@ public class UpgradeCatalog242Test {
 
     dbAccessor.dropFKConstraint(eq(UpgradeCatalog242.HOST_GROUP_TABLE), eq("FK_hg_blueprint_name"));
     dbAccessor.dropFKConstraint(eq(UpgradeCatalog242.BLUEPRINT_CONFIGURATION), eq("FK_cfg_blueprint_name"));
+    dbAccessor.dropFKConstraint(eq(UpgradeCatalog242.BLUEPRINT_CONFIGURATION), eq("FK_blueprint_configuration_blueprint_name"));
     dbAccessor.dropFKConstraint(eq(UpgradeCatalog242.BLUEPRINT_SETTING), eq("FK_blueprint_setting_name"));
 
     dbAccessor.alterColumn(eq(UpgradeCatalog242.BLUEPRINT_TABLE), capture(blueprintBlueprintNameColumnChangeSize));


Mime
View raw message