nova/nova/tests/functional/db
melanie witt 79df36fecf 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: Ie62d3566230aa3e2786d129adbb2e3570b06e4c6
(cherry picked from commit 1c256cf774)
(cherry picked from commit 09784db62f)
2020-11-02 17:53:31 +00:00
..
api Add reserved schema migrations for Ussuri 2019-10-03 08:47:36 -07:00
__init__.py Add second migrate_repo for cells v2 database migrations 2015-03-03 15:41:40 -05:00
test_aggregate.py DB API changes to get non-matching aggregates from metadata 2019-09-12 16:56:32 -05:00
test_aggregate_model.py Add aggregates tables to the API db. 2016-06-01 12:00:56 -05:00
test_archive.py Prevent archiving of pci_devices records because of 'instance_uuid' 2020-11-02 17:53:31 +00:00
test_build_request.py Fix misuse of nova.objects.base.obj_equal_prims 2019-08-13 09:38:54 +09:00
test_cell_mapping.py Address feedback from instance_list smart-cell behavior 2018-05-10 09:59:36 -07:00
test_compute_api.py Create request spec, build request and mappings in one transaction 2019-04-24 19:24:50 +00:00
test_compute_node.py Fix invalid assertIsNone states 2019-06-28 17:37:15 +08:00
test_connection_switch.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_console_auth_token.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_flavor.py Remove old flavor_get_all db api method 2018-02-14 15:53:18 -05:00
test_flavor_model.py Add Flavor.description attribute 2017-11-05 01:24:01 -05:00
test_host_mapping.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_instance.py Add Instance.hidden field 2019-08-07 17:56:01 -04:00
test_instance_group.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_instance_mapping.py Add get_counts() to InstanceMappingList 2019-04-10 22:15:16 +00:00
test_keypair.py Drop migrate_keypairs_to_api_db data migration 2019-04-03 11:42:48 -04:00
test_quota.py Make quotas respect instance_list_per_project_cells 2020-05-19 02:20:28 +00:00
test_quota_model.py Add quota related tables to the api database. 2016-10-12 07:40:00 +00:00
test_quotas.py Add online migration to move quotas to API database 2017-07-24 18:36:46 -04:00
test_request_spec.py Drop request spec migration code 2018-12-17 13:54:48 -05:00
test_security_group.py Add SecurityGroupList.get_counts() 2017-06-19 21:51:46 +00:00
test_virtual_interface.py func tests: move _run_periodics() into base class 2020-03-24 10:10:53 -04:00