From acd77dde9e623d1bc5804f60145418de4d612d5d Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Mon, 25 Jun 2018 12:05:06 -0400 Subject: [PATCH] Don't re-use resource-properties-data in backup stacks When purging events we are only able to (efficiently) search for references to resource properties data from events and resources in the same stack. This results in foreign key constraint errors if the resource properties data is referenced from a backup stack. To avoid this, don't reuse resource properties data IDs after moving a resource between the backup and main stacks, but duplicate the data instead. Change-Id: I93329197c99a2dba37b0e1dbd7efe7b2b17bc036 Story: #2002643 Task: 22510 --- heat/engine/stack.py | 1 + 1 file changed, 1 insertion(+) diff --git a/heat/engine/stack.py b/heat/engine/stack.py index 31c3b7b42f..b28ac4a2b3 100644 --- a/heat/engine/stack.py +++ b/heat/engine/stack.py @@ -734,6 +734,7 @@ class Stack(collections.Mapping): def add_resource(self, resource): """Insert the given resource into the stack.""" + resource._rsrc_prop_data_id = None template = resource.stack.t resource.stack = self definition = resource.t.reparse(self.defn, template)