Rohit Yadav created CLOUDSTACK-9466:
---------------------------------------

             Summary: Upgrading to older CloudStack 4.0.x to 4.1.x causes sql 
contraint errors
                 Key: CLOUDSTACK-9466
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9466
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
            Reporter: Rohit Yadav
            Assignee: Rohit Yadav
             Fix For: 4.10.0, 4.9.1


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to