[openstack-dev] [Keystone] migration scripts hang for MySQL

Adam Young ayoung at redhat.com
Fri Jan 18 23:12:49 UTC 2013


I've been trying to get the Unit tests for the migration scripts to run 
in MySQL.  It has been a slog.  They have been hanging.  You can see 
this by modifying the file tests/backend_sql.conf  to comment out sqlite 
and uncomment mysql.

./run_tests.sh -N test_sql_upgrade

I often have to connect to the mysql Database using the command line and 
set the DB to a known state using:

drop database keystone; create database keystone;

Once this is done, I find that it hangs on the 3rd test:

./run_tests.sh -N test_sql_upgrade:SqlUpgradeTests.test_downgrade_12_to_9


I've been running this in the debugger.  It is hanging on the downgrade 
stage at 001_add_initial_tables.py  downgrade.  The last line iterates 
through the tables and drops them. If hangs dropping the 'endpoint' table.

If I look at the database while the script is hung with
mysql>use keystone
...
mysql> show tables;
+--------------------+
| Tables_in_keystone |
+--------------------+
| endpoint           |
| migrate_version    |
| service            |
+--------------------+

But then once I kill the script:
mysql> show tables;
+--------------------+
| Tables_in_keystone |
+--------------------+
| migrate_version    |
| service            |
+--------------------+
2 rows in set (0.00 sec)


Something in the script holding a reference to the endpoint table.

Note that to get MySQL to run,  you need to roll back the "rename" patch 
that we recently did.  I have attached a patch that does just that, as 
well as another I was running with the ensures the session is closed in 
all unit tests.


I don't think this is a problem with the migration, but rather with the 
unit tests, but I think we should treat it as if we have a unit test 
failure until this is fixed.

I think that Postgres is going to require an additional change. "user" 
is a keyword in Postgres, but it is the name of one of out tables.  TO 
escape it in Postgres, we need to modify the scripts so the table name 
is in double quotes.  That syntax does not work with MySQL.  So the 
scripts are going to be a little uglier moving forward.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: keystone-admiyo-0000-close-sessions-in-tearDown.patch
Type: text/x-patch
Size: 3313 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130118/e02e6731/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keystone-admiyo-0001-column-drop.patch
Type: text/x-patch
Size: 2621 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130118/e02e6731/attachment-0001.bin>


More information about the OpenStack-dev mailing list