[rt] Apply migration context for incoming migrations
There is a race condition between an incoming resize and an
update_available_resource periodic in the resource tracker. The race
window starts when the resize_instance RPC finishes and ends when the
finish_resize compute RPC finally applies the migration context on the
instance.
In the race window, if the update_available_resource periodic is run on
the destination node, then it will see the instance as being tracked on
this host as the instance.node is already pointing to the dest. But the
instance.numa_topology still points to the source host topology as the
migration context is not applied yet. This leads to CPU pinning error if
the source topology does not fit to the dest topology. Also it stops the
periodic task and leaves the tracker in an inconsistent state. The
inconsistent state only cleanup up after the periodic is run outside of
the race window.
This patch applies the migration context temporarily to the specific
instances during the periodic to keep resource accounting correct.
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /820553 /opendev. org/openstack/ nova/commit/ 1235dc324ebc1c6 ac6dc94da0f45ff ffcc546d2c
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/xena
commit 1235dc324ebc1c6 ac6dc94da0f45ff ffcc546d2c
Author: Balazs Gibizer <email address hidden>
Date: Mon Dec 6 17:06:51 2021 +0100
[rt] Apply migration context for incoming migrations
There is a race condition between an incoming resize and an available_ resource periodic in the resource tracker. The race
update_
window starts when the resize_instance RPC finishes and ends when the
finish_resize compute RPC finally applies the migration context on the
instance.
In the race window, if the update_ available_ resource periodic is run on numa_topology still points to the source host topology as the
the destination node, then it will see the instance as being tracked on
this host as the instance.node is already pointing to the dest. But the
instance.
migration context is not applied yet. This leads to CPU pinning error if
the source topology does not fit to the dest topology. Also it stops the
periodic task and leaves the tracker in an inconsistent state. The
inconsistent state only cleanup up after the periodic is run outside of
the race window.
This patch applies the migration context temporarily to the specific
instances during the periodic to keep resource accounting correct.
Change-Id: Icaad155e22c9e2 d86e464a0deb741 c73f0dfb28a 712c8e3abdf8b3e 4cff234a9c)
Closes-Bug: #1953359
Closes-Bug: #1952915
(cherry picked from commit 32c1044d86a8d02