[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.
Conflicts: on resource_tracker: changed
'MigrationList.get_in_progress_and_error' call back to
'MigrationList.get_in_progress_by_host_and_node', since this change was
only added by 255b3f2f918843ca5dd9b99e109ecd2189b6b749, and is not
present in stable/ussuri.
Change-Id: Icaad155e22c9e2d86e464a0deb741c73f0dfb28a
Closes-Bug: #1953359
Closes-Bug: #1952915
(cherry picked from commit 32c1044d86a8d02712c8e3abdf8b3e4cff234a9c)
(cherry picked from commit 1235dc324ebc1c6ac6dc94da0f45ffffcc546d2c)
(cherry picked from commit 5f2f283a75243d2e2629d3c5f7e5ef4b3994972d)
(cherry picked from commit d54bd316b331d439a26a7318ca68cab5f6280ab2)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /822050 /opendev. org/openstack/ nova/commit/ 1d0b7051da430ed 00ae49901a32ec6 af46c1a64e
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/ussuri
commit 1d0b7051da430ed 00ae49901a32ec6 af46c1a64e
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.
Conflicts: on resource_tracker: changed ist.get_ in_progress_ and_error' call back to ist.get_ in_progress_ by_host_ and_node' , since this change was a5dd9b99e109ecd 2189b6b749, and is not
'MigrationL
'MigrationL
only added by 255b3f2f918843c
present in stable/ussuri.
Change-Id: Icaad155e22c9e2 d86e464a0deb741 c73f0dfb28a 712c8e3abdf8b3e 4cff234a9c) ac6dc94da0f45ff ffcc546d2c) e2629d3c5f7e5ef 4b3994972d) 9a26a7318ca68ca b5f6280ab2)
Closes-Bug: #1953359
Closes-Bug: #1952915
(cherry picked from commit 32c1044d86a8d02
(cherry picked from commit 1235dc324ebc1c6
(cherry picked from commit 5f2f283a75243d2
(cherry picked from commit d54bd316b331d43