Clear rebalanced compute nodes from resource tracker
There is a race condition in nova-compute with the ironic virt driver as
nodes get rebalanced. It can lead to compute nodes being removed in the
DB and not repopulated. Ultimately this prevents these nodes from being
scheduled to.
The issue being addressed here is that if a compute node is deleted by a host
which thinks it is an orphan, then the compute host that actually owns the node
might not recreate it if the node is already in its resource tracker cache.
This change fixes the issue by clearing nodes from the resource tracker cache
for which a compute node entry does not exist. Then, when the available
resource for the node is updated, the compute node object is not found in the
cache and gets recreated.
Change-Id: I39241223b447fcc671161c370dbf16e1773b684a
Partial-Bug: #1853009
(cherry picked from commit 32676a9f45807ea8770dc7bdff1e859673af1b61)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /811806 /opendev. org/openstack/ nova/commit/ f950cedf17cc4c3 ce9d094dbfde5e4 cf013260f7
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/wallaby
commit f950cedf17cc4c3 ce9d094dbfde5e4 cf013260f7
Author: Stephen Finucane <email address hidden>
Date: Wed Apr 28 13:53:39 2021 +0100
Clear rebalanced compute nodes from resource tracker
There is a race condition in nova-compute with the ironic virt driver as
nodes get rebalanced. It can lead to compute nodes being removed in the
DB and not repopulated. Ultimately this prevents these nodes from being
scheduled to.
The issue being addressed here is that if a compute node is deleted by a host
which thinks it is an orphan, then the compute host that actually owns the node
might not recreate it if the node is already in its resource tracker cache.
This change fixes the issue by clearing nodes from the resource tracker cache
for which a compute node entry does not exist. Then, when the available
resource for the node is updated, the compute node object is not found in the
cache and gets recreated.
Change-Id: I39241223b447fc c671161c370dbf1 6e1773b684a 8770dc7bdff1e85 9673af1b61)
Partial-Bug: #1853009
(cherry picked from commit 32676a9f45807ea