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:08:13 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4697e4709 -> b89b9e154


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

Branch: refs/heads/trunk
Commit: b89b9e1540b0ec539f62ee00d8bf82f1184f8af4
Parents: 4697e47
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Tue Nov 1 01:52:43 2016 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Tue Nov 1 01:54:00 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/b89b9e15/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/b89b9e15/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 29bf820..d6f3336 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
@@ -146,6 +146,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