Uploaded image for project: 'CloudStack'
  1. CloudStack
  2. CLOUDSTACK-9466

Upgrading to older CloudStack 4.0.x to 4.1.x causes sql contraint errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.10.0.0, 4.9.1.0, 4.8.2.0
    • None
    • Security Level: Public (Anyone can view this level - this is the default.)
    • None

    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

          Activity

            People

              bhaisaab Rohit Yadav
              bhaisaab Rohit Yadav
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: