software_config and software_deployment tables lack a deleted_at column

Bug #1346750 reported by Kanagaraj Manickam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Low
Kanagaraj Manickam

Bug Description

the cloumn 'deleted_at' is used in the tables for representing the deleted time and to support soft delete. Once soft delete is provided, admin will run the db_archive command to remove the soft deleted rows on as per the admin schedule.

In heat, following tables are missing with deleted_at column.
Software_config
Software_deployment
user_Creds
raw_template
resource
event
snapshot
resource_data

Changed in heat:
assignee: nobody → Kanagaraj Manickam (kanagaraj-manickam)
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: many tables lack a deleted_at column

I do not believe there is a need for deleted_at on most of these tables. Some have a stack_id or a direct relationship with a table that has a stack_id. The records will effectively vanish from the public API when the stack is marked as deleted. Others, such as raw_template and user_creds, are referred to directly in the stack record and thus may be 1:N and will be cleaned up when the stack is archived and there are no more references to them.

So only software_config and software_deployment are in need of deleted_at.

summary: - add deleted_at column to the stack tables
+ many tables lack a deleted_at column
summary: - many tables lack a deleted_at column
+ software_config and software_deployment tables lack a deleted_at column
Changed in heat:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Steven Hardy (shardy) wrote :

I agree with Clint, the only reason stack records are soft deleted is to enable events to be persisted for audit purposes, all of the resource related DB data should simply be deleted, we really don't want to start soft-deleting everything IMO.

Revision history for this message
Kanagaraj Manickam (kanagaraj-manickam) wrote :

Steven & Clint,

Thanks. I think, in addition to the software config tables, the raw_template table should be having the deleted_at, as during the auditing, it will be helpful to say that stack has gone thru changes from one template to another template as part of stack update. In the existing model, the old raw_template is not marked as deleted when the stack is updated from one template to new template.

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

At the moment I don't think the software_config and software_deployment tables need to switch to soft delete. Configs are quite ephemeral, and anything can be discovered about a deployment before its stack is deleted.

We can always revisit this in the future, but it should be driven by an actual use case.

Revision history for this message
Zane Bitter (zaneb) wrote :

I agree with Clint and Steve H that user_creds, resource, event, snapshot and resource_data are deleted when the stack is deleted, and do not require soft delete.

It would probably be a good idea to do a (hard) delete of the old raw_template after doing a stack update, but there's absolutely no need to do a soft delete because they will also be cleaned up when the stack is eventually hard-deleted.

I also agree with Steve B that software_config and software_deployment don't require soft delete at this stage.

Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
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.