> On Лис. 29, 2017, 10:54 після полудня, Sid Wagle wrote: > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java > > Lines 350 (patched) > > <https://reviews.apache.org/r/64174/diff/1/?file=1903976#file1903976line351> > > > > Will this delete existing data? Any implications of doing so?
Just 2 lines below we clear whole upgrade items table, if we don't clear this column FK constraint violation will appear. - Myroslav ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/64174/#review192169 ----------------------------------------------------------- On Лис. 29, 2017, 10:49 після полудня, Myroslav Papirkovskyy wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/64174/ > ----------------------------------------------------------- > > (Updated Лис. 29, 2017, 10:49 після полудня) > > > 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 > >
