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.
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /695187 /opendev. org/openstack/ nova/commit/ 32676a9f45807ea 8770dc7bdff1e85 9673af1b61
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 32676a9f45807ea 8770dc7bdff1e85 9673af1b61
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
Partial-Bug: #1853009