AMBARI-21836. Fix Upgrade failure because of missing table after AMBARI-21076 
checkin.


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

Branch: refs/heads/feature-branch-AMBARI-21307
Commit: d4ba96481c76487bc1fdd7fbde8392bc97c3226d
Parents: eef7b73
Author: Nishant <nishant.mon...@gmail.com>
Authored: Tue Aug 29 11:48:37 2017 +0530
Committer: Swapan Shridhar <sshrid...@hortonworks.com>
Committed: Wed Aug 30 12:38:46 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java | 4 ----
 .../org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java  | 2 --
 2 files changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d4ba9648/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index b4e7a02..2bd0f93 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -386,9 +386,6 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
   }
 
   private void removeComponent(String componentName, String configPrefix) 
throws SQLException {
-    String supersetConfigMappingRemoveSQL = String.format(
-        "DELETE FROM %s WHERE type_name like '%s%%'",
-        CLUSTER_CONFIG_MAPPING_TABLE, configPrefix);
 
     String serviceConfigMappingRemoveSQL = String.format(
         "DELETE FROM %s WHERE config_id IN (SELECT config_id from %s where 
type_name like '%s%%')",
@@ -410,7 +407,6 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
         "DELETE FROM %s WHERE component_name = '%s'",
         SERVICE_COMPONENT_DESIRED_STATE, componentName);
 
-    dbAccessor.executeQuery(supersetConfigMappingRemoveSQL);
     dbAccessor.executeQuery(serviceConfigMappingRemoveSQL);
     dbAccessor.executeQuery(supersetConfigRemoveSQL);
     dbAccessor.executeQuery(hostComponentDesiredStateRemoveSQL);

http://git-wip-us.apache.org/repos/asf/ambari/blob/d4ba9648/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
index b6c323e..d8e8171 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
@@ -487,8 +487,6 @@ public class UpgradeCatalog260Test {
     
expect(statement.executeQuery(anyObject(String.class))).andReturn(resultSet).anyTimes();
     
expect(configuration.getDatabaseType()).andReturn(Configuration.DatabaseType.POSTGRES).anyTimes();
 
-    dbAccessor.executeQuery("DELETE FROM clusterconfigmapping WHERE type_name 
like 'druid-superset%'");
-    expectLastCall().once();
     dbAccessor.executeQuery("DELETE FROM serviceconfigmapping WHERE config_id 
IN (SELECT config_id from clusterconfig where type_name like 
'druid-superset%')");
     expectLastCall().once();
     dbAccessor.executeQuery("DELETE FROM clusterconfig WHERE type_name like 
'druid-superset%'");

Reply via email to