placement/nova/db
Dan Smith 411113a2dd 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).

Closes-Bug: #1622545
Change-Id: I77255c77780f0c2b99d59a9c20adecc85335bb18
2016-09-27 12:08:21 -07:00
..
sqlalchemy Archive instance-related rows when the parent instance is deleted 2016-09-27 12:08:21 -07:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
api.py Add objects.ServiceList.get_all_computes_by_hv_type 2016-08-01 16:38:21 -04:00
base.py config options: centralize section "database" + "api_database" 2016-05-16 10:20:51 +00:00
migration.py Manage db sync command for cell0 2016-08-22 18:53:45 +03:00