Bug 1010039

Summary: Grizzly -> Havana upgrade fails during db_sync
Product: [Community] RDO Reporter: Dan Smith <dasmith>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED EOL QA Contact: Giulio Fidente <gfidente>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: eharney, rbowen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-cinder-2013.2-0.13.rc3.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-14 14:18:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 960990    

Description Dan Smith 2013-09-19 18:44:44 UTC
Description of problem:

Upgrading from Grizzly to Havana fails when trying to run cinder's database migrations.

Version-Release number of selected component (if applicable):

Starting with: 2013.1.3-1.el6
Upgrading to:  2013.2.0.8.b3.el6

How reproducible:

Always

Steps to Reproduce:
1. Install 2013.1.3-1
2. Start cinder
3. Stop cinder
4. Install 2013.2.0.8.b3
4. Run "cinder-manage db sync"

Actual results:

[root@test1 test_rdo_upgrade(keystone_admin)]# cinder-manage db sync
2013-09-19 11:41:56.954 556 ERROR 010_add_transfers_table [-] Table |Table('transfers', MetaData(bind=Engine(mysql://cinder:7f6a941a6b2348a2.101.6/cinder)), Column('created_at', DateTime(), table=<transfers>), Column('updated_at', DateTime(), table=<transfers>), Column('deleted_at', DateTime(), table=<transfers>), Column('deleted', Boolean(), table=<transfers>), Column('id', String(length=36), table=<transfers>, primary_key=True, nullable=False), Column('volume_id', String(length=36), ForeignKey('volumes.id'), table=<transfers>, nullable=False), Column('display_name', String(length=255), table=<transfers>), Column('salt', String(length=255), table=<transfers>), Column('crypt_hash', String(length=255), table=<transfers>), Column('expires_at', DateTime(), table=<transfers>), schema=None)| not created!
2013-09-19 11:41:56.955 556 CRITICAL cinder [-] (OperationalError) (1005, "Can't create table 'cinder.transfers' (errno: 150)") '\nCREATE TABLE transfers (\n\tcreated_at DATETIME, \n\tupdated_at DATETIME, \n\tdeleted_at DATETIME, \n\tdeleted BOOL, \n\tid VARCHAR(36) NOT NULL, \n\tvolume_id VARCHAR(36) NOT NULL, \n\tdisplay_name VARCHAR(255), \n\tsalt VARCHAR(255), \n\tcrypt_hash VARCHAR(255), \n\texpires_at DATETIME, \n\tPRIMARY KEY (id), \n\tCHECK (deleted IN (0, 1)), \n\tFOREIGN KEY(volume_id) REFERENCES volumes (id)\n)ENGINE=InnoDB\n\n' ()

Expected results:

cinder-manage upgrades database schema properly.

Additional info:

Reproducible starting from a clean EL6 system with:

https://github.com/kk7ds/test_rdo_upgrade

Comment 1 Dan Smith 2013-09-20 21:04:22 UTC
For easier copying, here's the failing SQL statement:

CREATE TABLE transfers ( created_at DATETIME,  updated_at DATETIME,  deleted_at DATETIME,  deleted BOOL,  id VARCHAR(36) NOT NULL,  volume_id VARCHAR(36) NOT NULL,  display_name VARCHAR(255),  salt VARCHAR(255),  crypt_hash VARCHAR(255),  expires_at DATETIME,  PRIMARY KEY (id),  CHECK (deleted IN (0, 1)),  FOREIGN KEY(volume_id) REFERENCES volumes (id) )ENGINE=InnoDB;

I think it must have something to do with constraints required for the Foreign Key relationship that aren't happy, but I'm not sure exactly.

Comment 2 Eric Harney 2013-10-02 19:57:28 UTC
Possible explanation: https://bugs.launchpad.net/cinder/+bug/1233861

Comment 3 Rich Bowen 2015-05-14 14:18:12 UTC
Refers to EOL'ed versions that are no longer maintained.