Details
Description
In one of the upgrade tests, in one of the upgrade paths a key contraint error occurs due to missing entry in the migration:
2016-08-22 14:42:09,060 DEBUG [c.c.u.d.Upgrade410to420] (main:null) (logid Migrating NFS secondary storage to Image store
2016-08-22 14:42:09,080 DEBUG [c.c.u.d.Upgrade410to420] (main:null) (logid Marking NFS secondary storage in host table as removed
2016-08-22 14:42:09,099 DEBUG [c.c.u.d.Upgrade410to420] (main:null) (logid Completed migrating secondary storage to image store
2016-08-22 14:42:09,099 DEBUG [c.c.u.d.Upgrade410to420] (main:null) (logid Updating volume_store_ref table from volume_host_ref table
2016-08-22 14:42:09,114 ERROR [c.c.u.d.Upgrade410to420] (main:null) (logid Unable to migrate volume_host_ref.Cannot add or update a child row: a foreign key constraint fails (`cloud`.`volume_store_ref`, CONSTRAINT `fk_volume_store_ref__store_id` FOREIGN KEY (`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE)
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`cloud`.`volume_store_ref`, CONSTRAINT `fk_volume_store_ref__store_id` FOREIGN KEY (`store_id`) REFERENCES `image_store` (`id`) ON DELETE CASCADE)
>---at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>---at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>---at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>---at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
On analysis it was found that nfs storage that were removed were not migrated causing discrepancy in migrated data. Later when volumes/templates are migrated it causes sql constraint issues as the nfs sec storage it refers does not exist.
Attachments
Issue Links
- links to