Running 'glance db_sync' against an external mysql server (mysql-server-5.5 5.5.17-4ubuntu6) glance appears to deadlock in 003_add_disk_format.py. A little bit of tracing reveals the call to 'disk_format.create(images)' on line 111 never returns. Meanwhile, 'show processlist' shows:
| glance | 10.252.28.238:60409 | glance | Sleep | 26 | | NULL |
| 5837 | glance | 10.252.28.238:60410 | glance | Query | 26 | Waiting for table metadata lock | ALTER TABLE images ADD disk_format VARCHAR(20) |
I've confirmed that pointing at an oneiric mysql server (mysql-server-5.1 5.1.58-1ubuntu1) does not run into the same problems. Its probably worth noting that mysql 5.5 ships with a different configuration, most notably enabling InnoDB by default, tho I could not reproduce on oneiric using InnoDB.
FWIW, I've also found that this only becomes a problem if I've deployed everything once, automated using Juju, then manually 'drop database glance ; create database glance;' and attempt to rerun the migrations. After its been dropped and recreated, it deadlocks 100% of the time.