From 1d0402cf65458c941639f01334a996c11e592018 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Thu, 4 Oct 2012 14:10:32 -0700 Subject: Set read_deleted='yes' for instance_id_mappings. Since the migration that creates the instance_id_mappings does not populated the 'deleted' column, queries to this table should not limit results to 'deleted=0'. Limiting to non-deleted rows results in duplicate mappings being created for existing instance mappings after an upgrade, and throws off the entire EC2 instance ID to UUID mapping. Fixes LP: #1061166 Change-Id: I8893954fcae94a71dcc284c1b3b23b53901437eb --- nova/db/sqlalchemy/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 5e38d6e14..dde41a67a 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -5185,7 +5185,10 @@ def get_instance_uuid_by_ec2_id(context, ec2_id, session=None): @require_context def _ec2_instance_get_query(context, session=None): - return model_query(context, models.InstanceIdMapping, session=session) + return model_query(context, + models.InstanceIdMapping, + session=session, + read_deleted='yes') @require_admin_context -- cgit