nova/nova/tests/functional
Dan Smith 76d1b24c00 Archive instance-related rows when the parent instance is deleted
This is something I expect has been very broken for a long time. We
have rows in tables such as instance_extra, instance_faults, etc that
pertain to a single instance, and thus have a foreign key on their
instance_uuid column that points to the instance. If any of those
records exist, an instance can not be archived out of the main
instances table.

The archive routine currently "handles" this by skipping over said
instances, and eventually iterating over all the tables to pull out
any records that point to that instance, thus freeing up the instance
itself for archival. The problem is, this only happens if those extra
records are actually marked as deleted themselves. If we fail during
a cleanup routine and leave some of them not marked as deleted, but
where the instance they reference *is* marked as deleted, we will
never archive them.

This patch adds another phase of the archival process for any table
that has an "instance_uuid" column, which attempts to archive records
that point to these deleted instances. With this, using a very large
real world sample database, I was able to archive my way down to
zero deleted, un-archivable instances (from north of 100k).

Conflicts:
	nova/db/sqlalchemy/api.py (indentation change)

Closes-Bug: #1622545
Change-Id: I77255c77780f0c2b99d59a9c20adecc85335bb18
(cherry picked from commit ceaf853894)
2016-09-28 07:08:44 -07:00
..
api Drop the use of magic openstack project_id 2016-03-08 19:34:56 +00:00
api_sample_tests Drop the use of magic openstack project_id 2016-03-08 19:34:56 +00:00
db Archive instance-related rows when the parent instance is deleted 2016-09-28 07:08:44 -07:00
libvirt Remove unused CONF imports 2016-02-15 16:40:53 +11:00
notification_sample_tests Revert "functional: Grab the service version from the module" 2016-03-07 12:48:40 -05:00
regressions Fixes unexpectedly passing functional test. 2016-04-15 20:52:00 +00:00
wsgi Convert nova.tests.unit.image.fake.stub_out_image_service to use stub_out 2016-01-06 16:42:20 -08:00
__init__.py move eventlet GREENDNS override to top level 2014-12-08 17:41:03 -05:00
api_paste_fixture.py Fixed incorrect names/comments for API version 2.18 2016-01-25 11:36:47 +03:00
api_samples_test_base.py Drop the use of magic openstack project_id 2016-03-08 19:34:56 +00:00
integrated_helpers.py Removal of unnecessary `import_opt`s for cells config options 2016-02-12 14:16:54 +02:00
test_extensions.py update api_samples code to use better variables 2015-12-14 11:23:26 +08:00
test_instance_actions.py make microversion a client level construct for tests 2016-02-24 11:02:05 -05:00
test_legacy_v2_compatible_wrapper.py Replace stubs.Set with stub_out (fakes) 2016-01-13 22:19:38 -05:00
test_login.py update api_samples code to use better variables 2015-12-14 11:23:26 +08:00
test_middleware.py Added CORS support to Nova 2015-11-11 14:28:50 -08:00
test_server_group.py Properly clean up BDMs when _provision_instances fails 2016-04-20 13:25:31 -04:00
test_servers.py Cleanup service.kill calls in functional tests 2016-02-28 16:44:57 -05:00