heat/heat/db/sqlalchemy
Zane Bitter 7daa3bdbf3 Ignore errors in purging events
There is a known issue with purging the resource properties data for events
where the same resource properties data is referenced by a resource or
event in the backup stack.

It's more important that we are able to store a new event than that we are
able to purge old events, so catch any exceptions in purging and log an
error, rather than allowing the exception to abort the event creation.

Also use a transaction to ensure that we roll back the deletion of the
events when we encounter an error. This ensures that any resource
properties data *not* referenced by the backup stack is not orphaned
because of failures deleting other rows. This will allow us to properly
purge the database once the issue is fixed.

Change-Id: Iefa706f91382f7d1c47e09e8f67a9fad53a9390b
Story: #2002643
Task: 22334
(cherry picked from commit 6169ed4660)
2018-06-28 14:14:50 +00:00
..
migrate_repo Squash database patches 2017-03-14 15:52:46 +08:00
__init__.py Stub out the database access API 2012-03-29 18:02:16 +02:00
api.py Ignore errors in purging events 2018-06-28 14:14:50 +00:00
filters.py replace dict.iteritems() with six.iteritems(dict) 2014-08-06 10:56:09 +08:00
migration.py Squash database patches 2017-03-14 15:52:46 +08:00
models.py Data migration enabling storage of resource attributes 2017-02-16 16:08:31 -05:00
types.py Remove usage of sqlalchemy mutables 2015-06-26 11:02:03 +02:00
utils.py Replace retrying with tenacity 2016-11-15 04:34:17 +00:00