From 4885aa28706a1858f4fc51a0d2c661eec05139c0 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Wed, 29 May 2013 14:21:00 +0000 Subject: Don't delete sys_meta on instance delete Unfortunately, we require to access instance_system_metadata to get data (specifically at least instance_type data) for instances that have been deleted. There's 2 cases where this is true: 1) nova-api supports showing deleting instances when you specify a 'changes-since' param. 2) The _usage_audit_log periodic task pulls all instances during the audit period, which includes instances that have been deleted during that period. This reverts commit 17bca438954638d74035d560e826a26a532b3ea3, which was attempting to fix a bug where we leave instance_system_metadata entries undeleted from the DB. There's not an easy way to query for the deleted sys_meta data in an efficient manner, and leaving the entries undeleted is the lesser of the 2 evils for now. Fixes bug 1185190 Change-Id: I898f0546c49126dcc56a4237120082f95dc82304 --- nova/db/sqlalchemy/api.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'nova/db') diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 68eb25ebf..10326e723 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -1510,9 +1510,6 @@ def instance_destroy(context, instance_uuid, constraint=None): session.query(models.InstanceMetadata).\ filter_by(instance_uuid=instance_uuid).\ soft_delete() - session.query(models.InstanceSystemMetadata).\ - filter_by(instance_uuid=instance_uuid).\ - soft_delete() return instance_ref -- cgit