When the update resources periodic task runs, it pulls migrations from the database using [1], which filters out migrations in 'accepted' status. Live migrations are created with an 'accepted' status by the conductor [2], and are only set to 'preparing' by the compute manager here [3], which happens after all the new NUMA-aware live migrations claims stuff. So there's a time window after the claim but before the migration has been set to 'preparing' during which, if the periodic resource update task kicks in, it will miss the migration, see that the instance is still on the source host according to the database, and free its resources from the destination.
Figured it out:
When the update resources periodic task runs, it pulls migrations from the database using [1], which filters out migrations in 'accepted' status. Live migrations are created with an 'accepted' status by the conductor [2], and are only set to 'preparing' by the compute manager here [3], which happens after all the new NUMA-aware live migrations claims stuff. So there's a time window after the claim but before the migration has been set to 'preparing' during which, if the periodic resource update task kicks in, it will miss the migration, see that the instance is still on the source host according to the database, and free its resources from the destination.
[1] https:/ /github. com/openstack/ nova/blob/ 0ce66605e16aca8 5df97acdd8c4598 02fcdb9aa0/ nova/db/ sqlalchemy/ api.py# L4422 /github. com/openstack/ nova/blob/ 0ce66605e16aca8 5df97acdd8c4598 02fcdb9aa0/ nova/conductor/ manager. py#L422 /github. com/openstack/ nova/blob/ 0ce66605e16aca8 5df97acdd8c4598 02fcdb9aa0/ nova/compute/ manager. py#L7020
[2] https:/
[3] https:/