Do the api_db sync before db sync

This patch swaps the order of doing api_db sync with db_sync.
The API database migration should be run before the migrations for
the main/cell databases. This is because the former contains
information about how to find and connect to the latter.

This was discovered in Rocky since we added a data model change
(a new column to the cell_mappings table) that depends on db sync
being run after having added this new column to the api_db (i.e running
api_db sync before db sync). The data model change was the first time
where the actual sync order became meaningful.

This has been correctly done in devstack and the fact that grenade was
doing the db sync before api_db sync was hidden by the fact that
devstack had run at least once before reaching this part of grenade,
which meant that the database was already initialized.

Change-Id: Ic790ef7c3531c2b672621310524797548246b2ef
Closes-Bug: #1761775
This commit is contained in:
Surya Seetharaman 2018-04-06 17:26:36 +02:00
parent 200435721f
commit dc7f4a4ba5

View File

@ -71,8 +71,8 @@ upgrade_project nova $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
create_nova_keys_dir
# Migrate the database
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync || die $LINENO "DB sync error"
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync || die $LINENO "API DB sync error"
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync || die $LINENO "DB sync error"
iniset $NOVA_CONF upgrade_levels compute auto