소스 검색

AMBARI-16939. 'ambari-server upgrade' is failed : Error executing schema upgrade [upgrade from 2200 to 2400] (Balázs Bence Sári via magyari_sandor)

Sandor Magyari 9 년 전
부모
커밋
9976ef287f
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java

+ 4 - 0
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java

@@ -1398,8 +1398,12 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
     }
 
     // drop FKs to SCDS in both HCDS and HCS tables
+    // These are the expected constraint names
     dbAccessor.dropFKConstraint(HOST_COMPONENT_DS_TABLE, "hstcmpnntdesiredstatecmpnntnme");
     dbAccessor.dropFKConstraint(HOST_COMPONENT_STATE_TABLE, "hstcomponentstatecomponentname");
+    // These are the old (pre Ambari 1.5) constraint names, however still found on some installations
+    dbAccessor.dropFKConstraint(HOST_COMPONENT_DS_TABLE, "FK_hostcomponentdesiredstate_component_name");
+    dbAccessor.dropFKConstraint(HOST_COMPONENT_STATE_TABLE, "FK_hostcomponentstate_component_name");
 
     // remove existing compound PK
     dbAccessor.dropPKConstraint(SERVICE_COMPONENT_DS_TABLE, "servicecomponentdesiredstate_pkey");