Comment 8 for bug 1335804

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote : Re: OS deployment fail: nova-manage db sync returned 1 instead of one of [0]

From logs it's clear that nova-api/nova-conductor are up and running before *nova-manage db sync* has completed. It means that nova-api is using partially applied DB schema, which obviously can't work well.

Initial Havana migration script (216_havana.py) is written in a way, so that it creates all the tables first and then adds constraints to those tables. In this particular case *all the tables* have been created, nova-api is running and processing queries, but table 'services' is missing one important unique constraint: without this constraint a race condition is possible, which leads to addition of two equivalent entries. Later in 216_havana we try to create this unique constraint and fail.

While this particular problem *can* be fixed in Nova, that would require patching of upstream db schema migrations, and I'm not sure that's the way to go. In general, you can't expect nova-api to work reliably, if it's run before nova-manage db sync has completed.