[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.
Change-Id: Icaad155e22c9e2d86e464a0deb741c73f0dfb28a
Closes-Bug: #1953359
Closes-Bug: #1952915
(cherry picked from commit 32c1044d86a8d02712c8e3abdf8b3e4cff234a9c)
(cherry picked from commit 1235dc324ebc1c6ac6dc94da0f45ffffcc546d2c)
(cherry picked from commit 5f2f283a75243d2e2629d3c5f7e5ef4b3994972d)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /820559 /opendev. org/openstack/ nova/commit/ d54bd316b331d43 9a26a7318ca68ca b5f6280ab2
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/victoria
commit d54bd316b331d43 9a26a7318ca68ca b5f6280ab2
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) ac6dc94da0f45ff ffcc546d2c) e2629d3c5f7e5ef 4b3994972d)
Closes-Bug: #1953359
Closes-Bug: #1952915
(cherry picked from commit 32c1044d86a8d02
(cherry picked from commit 1235dc324ebc1c6
(cherry picked from commit 5f2f283a75243d2