EC2 instance_id_mappings are never deleted

Bug #1890057 reported by Mohammed Naser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

It looks like whenever we create an instance, we create an EC2 instance ID mapping for it:

https://github.com/openstack/nova/blob/df49ad9b29afcafa847b83df445b6627350721b5/nova/db/sqlalchemy/api.py#L1137-L1138

Which is used by the EC2 objects:

https://github.com/openstack/nova/blob/df49ad9b29afcafa847b83df445b6627350721b5/nova/objects/ec2.py

Which is not really used by much in the API, but it even has a mechanism to 'soft-create' mappings when they pop up:

https://github.com/openstack/nova/blob/df49ad9b29afcafa847b83df445b6627350721b5/nova/objects/ec2.py#L63-L74

but a lot of the code seems unreferenced, so I am not sure what is the state of this, however, the problem comes in the fact that it never gets soft deleted anywhere in the code which can lead to...

```
MariaDB [nova]> SELECT COUNT(*) FROM instance_id_mappings;
+----------+
| COUNT(*) |
+----------+
| 3941119 |
+----------+
```

For something entirely not used. I think the fix could be two parts (but I don't understand why the EC2 API is still referneced):

1. Mappings should be created on-demand (which in my case they never will)
2. Mappings should be soft deleted on instane delete (which should make the archiving work).

I'm happy to try and help drive this if we come up with a solution.

Revision history for this message
melanie witt (melwitt) wrote :

This should have been fixed in Stein:

https://bugzilla.redhat.com/show_bug.cgi?id=1726256#c22

and looks like a duplicate of:

https://bugs.launchpad.net/nova/+bug/1786298

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.