]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
FK lookup failures during migration
authorJohn Griffith <john.griffith@solidfire.com>
Tue, 15 Oct 2013 19:57:48 +0000 (13:57 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Tue, 15 Oct 2013 20:46:56 +0000 (14:46 -0600)
There are a couple of cases where migrations have failed
upgrading from Grizzly to Havana, this seems to be isolated
to a couple of migrations so far and the error message is a
failure to lookup/associate the volume-id FK dependency.

It appears that this is caused by not setting the charset
in the migration, so the result is that the initial db setup
uses utf8 and the migrations are using the default latin1.

This patch goes through all of the migrations in Havana that
specify InnoDB and explicitly sets the charset to utf8 to match
the volumes table (and the other original tables).

Change-Id: I43b219ff5e4eea10a7391ad65ef68a80b7460370
Closes-Bug: #1233861

cinder/db/sqlalchemy/migrate_repo/versions/010_add_transfers_table.py
cinder/db/sqlalchemy/migrate_repo/versions/015_drop_migrations_table.py
cinder/db/sqlalchemy/migrate_repo/versions/016_drop_sm_tables.py
cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py
cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py
cinder/db/sqlalchemy/migrate_repo/versions/020_add_volume_admin_metadata_table.py

index 781a443704d46128153431b1817ff30d6f7be733..26b4bd6b2e233512a1edfca3045753717631f9f7 100644 (file)
@@ -40,7 +40,8 @@ def upgrade(migrate_engine):
         Column('salt', String(length=255)),
         Column('crypt_hash', String(length=255)),
         Column('expires_at', DateTime(timezone=False)),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     try:
index 2de50be94aaf5690e9d2931c49a07daf7d5baf22..75627b371be12a1c5042da1b1cb38306d7b14140 100644 (file)
@@ -53,7 +53,8 @@ def downgrade(migrate_engine):
         Column('new_instance_type_id', Integer),
         Column('instance_uuid', String(length=255), nullable=True),
         Column('status', String(length=255)),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     try:
index 0ad1fafc8ddb992bf0e85c159444cc80941aca62..2dabaa51ad259a9805c5fe1b56204009b9f55648 100644 (file)
@@ -59,7 +59,8 @@ def downgrade(migrate_engine):
         Column('sr_uuid', String(length=255)),
         Column('sr_type', String(length=255)),
         Column('config_params', String(length=2047)),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     sm_flavors = Table(
@@ -71,7 +72,8 @@ def downgrade(migrate_engine):
         Column('id', Integer, primary_key=True, nullable=False),
         Column('label', String(length=255)),
         Column('description', String(length=255)),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     sm_volume = Table(
@@ -87,7 +89,8 @@ def downgrade(migrate_engine):
         Column('backend_id', Integer, ForeignKey('sm_backend_config.id'),
                nullable=False),
         Column('vdi_uuid', String(length=255)),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     tables = [sm_flavors, sm_backend_config, sm_volume]
index 6b80969d1b56b0a847e2afeacc6aa1090c3deacc..df434710100664b8203f3f573b45ad3258aa6a20 100644 (file)
@@ -74,7 +74,8 @@ def upgrade(migrate_engine):
         Column('volume_type_id', String(length=36),
                ForeignKey(volume_types.c.id),
                primary_key=True, nullable=False),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     try:
index a67b58744278fcd53a621a1f885183433a712bab..c5fbe73bef6c5abf00ef601c3714c6b1bb60f8d9 100644 (file)
@@ -40,7 +40,8 @@ def upgrade(migrate_engine):
                ForeignKey('quality_of_service_specs.id')),
         Column('key', String(255)),
         Column('value', String(255)),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     try:
index f59c5c88c7aadd11b1b76204fac56d2b3eed102e..0cfe9ae42dd3e39c546957554d216e26ad28f216 100644 (file)
@@ -38,7 +38,8 @@ def upgrade(migrate_engine):
                nullable=False),
         Column('key', String(length=255)),
         Column('value', String(length=255)),
-        mysql_engine='InnoDB'
+        mysql_engine='InnoDB',
+        mysql_charset='utf8'
     )
 
     try: