Comment 13 for bug 1583504

Revision history for this message
Margarita Shakhova (shakhova-margarita) wrote :

I mean that at previous lines we get:

evacuations = objects.MigrationList.get_by_filters(context, filters)

there could be more than one row for which satus is 'accepted' or 'done' and migration_type='evacuation'

If there are more than one raw with the same instance_uuid the first one record in the dict will be created using the first raw, if one more raw found than the value for the same key will be just updated. Therefore we will always have just one value for the instance_uuid key.

In L701 migration status will be updated to 'completed', if we have more than one accepted/done migrations for the same instance_uuid, this code will update only last one. At the next nova-compute restart instance will be rebooted.

I am trying to investigate in what case it is possible to have several such records for the same instance at the host in DB. Before fix https://review.openstack.org/#/c/499237/ it was very easy to reproduce: just call 'evacuate' several times and see several 'accepted' migrations of the same instance from the same host. I am not sure if this is likely to happen now, but just in case it would be better to look for all such records in Migrations.