-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64174/
-----------------------------------------------------------

Review request for Ambari, Andrew Onischuk and Sid Wagle.


Bugs: AMBARI-22544
    https://issues.apache.org/jira/browse/AMBARI-22544


Repository: ambari


Description
-------

When upgrading from Ambari 2.5.2 to Ambari 2.6.0, we hit this error preventing 
from completing the ambari-server upgrade.

```
20 Nov 2017 11:39:08,115 ERROR [main] SchemaUpgradeHelper:202 - Upgrade failed.
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Cannot delete or update a parent row: a foreign key constraint fails 
(`ambari_01`.`clusters`, CONSTRAINT `FK_clusters_upgrade_id` FOREIGN KEY 
(`upgrade_id`) REFERENCES `upgrade` (`upgrade_id`))
```

To get around this, we had to restore the db backup from 2.5.3 and adjust a 
table in mysql with ‘update clusters set upgrade_id = null’ so a record in the 
‘upgrades’ table could be removed.


Diffs
-----

  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
 35f9f65dc89302aaf4c555d269beb221f2c0a793 
  
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog260Test.java
 c6111712c3f79347234d282461e0d9f0ed5a8b75 


Diff: https://reviews.apache.org/r/64174/diff/1/


Testing
-------

mvn clean test
manual check of described case


Thanks,

Myroslav Papirkovskyy

Reply via email to