Prevent archiving of pci_devices records because of 'instance_uuid'
Currently in the archive_deleted_rows code, we will attempt to clean up
"residue" of deleted instance records by assuming any table with a
'instance_uuid' column represents data tied to an instance's lifecycle
and delete such records.
This behavior poses a problem in the case where an instance has a PCI
device allocated and someone deletes the instance. The 'instance_uuid'
column in the pci_devices table is used to track the allocation
association of a PCI with an instance. There is a small time window
during which the instance record has been deleted but the PCI device
has not yet been freed from a database record perspective as PCI
devices are freed during the _complete_deletion method in the compute
manager as part of the resource tracker update call.
Records in the pci_devices table are anyway not related to the
lifecycle of instances so they should not be considered residue to
clean up if an instance is deleted. This adds a condition to avoid
archiving pci_devices on the basis of an instance association.
Reviewed: https:/ /review. opendev. org/757656 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=1c256cf7746 93e2395ae8fe4a7 a2f416a7aeb03a
Committed: https:/
Submitter: Zuul
Branch: master
commit 1c256cf774693e2 395ae8fe4a7a2f4 16a7aeb03a
Author: melanie witt <email address hidden>
Date: Mon Oct 12 22:27:52 2020 +0000
Prevent archiving of pci_devices records because of 'instance_uuid'
Currently in the archive_ deleted_ rows code, we will attempt to clean up
"residue" of deleted instance records by assuming any table with a
'instance_uuid' column represents data tied to an instance's lifecycle
and delete such records.
This behavior poses a problem in the case where an instance has a PCI
device allocated and someone deletes the instance. The 'instance_uuid'
column in the pci_devices table is used to track the allocation
association of a PCI with an instance. There is a small time window
during which the instance record has been deleted but the PCI device
has not yet been freed from a database record perspective as PCI
devices are freed during the _complete_deletion method in the compute
manager as part of the resource tracker update call.
Records in the pci_devices table are anyway not related to the
lifecycle of instances so they should not be considered residue to
clean up if an instance is deleted. This adds a condition to avoid
archiving pci_devices on the basis of an instance association.
Closes-Bug: #1899541
Change-Id: Ie62d3566230aa3 e2786d129adbb2e 3570b06e4c6