[openstack-dev] [nova] nova-manage db archive_deleted_rows broken

Matt Riedemann mriedem at linux.vnet.ibm.com
Fri Nov 20 15:51:43 UTC 2015

On 11/20/2015 8:18 AM, Sean Dague wrote:
> On 11/17/2015 10:51 PM, Matt Riedemann wrote:
> <snip>
>> I *don't* see any DB APIs for deleting instance actions.
>> Kind of an important difference there.  Jay got it at least. :)
>>> Were we just planning on instance_actions living forever in the database?
>>> Should we soft delete instance_actions when we delete the referenced
>>> instance?
>>> Or should we (hard) delete instance_actions when we archive (move to
>>> shadow tables) soft deleted instances?
>>> This is going to be a blocker to getting nova-manage db
>>> archive_deleted_rows working.
>>> [1] https://review.openstack.org/#/c/246635/
> instance_actions seems extremely useful, and at the ops meetups I've
> been to has been one of the favorite features because it allows and easy
> interface for "going back in time" to figure out what happened.
> I'd suggest the following:
> 1. soft deleting and instance does nothing with instance actions.
> 2. archiving instance (soft delete -> actually deleted) also archives
> off instance actions.

I think this is also the right approach. Then we don't need to worry 
about adding soft delete for instance_actions, they are just archived 
when you archive the instances. It probably makes the logic in the 
archive code messier for this separate path, but it's looking like we're 
going to have to account for the bw_usage_cache table too (which has a 
uuid column for an instance but no foreign key back to the instances 
table and is not soft deleted).

> 3. update instance_actions API so that you can get instance_actions for
> deleted instances (which I think doesn't work today).

Right, it doesn't. I was going to propose a spec for that since it's a 
simple API change with a microversion.

> 	-Sean



Matt Riedemann

More information about the OpenStack-dev mailing list