the way that I tried to test it is this: create a stack -> this created two raw templates updated the stack with the same template, now we have 3 raw_templates unless I missing something, this bug hasn't been fixed in this version. tested in RHEL 7.1 version 2015.1.1-6.el7 after create and 1 update: MariaDB [heat]> select * from raw_template\G; *************************** 1. row *************************** id: 1 created_at: 2015-10-14 10:35:11 updated_at: NULL template: {"outputs": {"PublicKey": {"value": {"get_attr": ["KeyPair", "public_key"]}}, "PrivateKey": {"value": {"get_attr": ["KeyPair", "private_key"]}}}, "heat_template_version": "2013-05-23", "parameters": {"key_name": {"default": "heat_key_test", "type": "string"}, "key_save": {"default": false, "type": "string"}}, "resources": {"KeyPair": {"type": "OS::Nova::KeyPair", "properties": {"name": {"get_param": "key_name"}, "save_private_key": {"get_param": "key_save"}}}}} files: {} environment: {"parameter_defaults": {}, "parameters": {}, "resource_registry": {"resources": {}}} predecessor: NULL *************************** 2. row *************************** id: 2 created_at: 2015-10-14 10:38:37 updated_at: NULL template: {"outputs": {"PublicKey": {"value": {"get_attr": ["KeyPair", "public_key"]}}, "PrivateKey": {"value": {"get_attr": ["KeyPair", "private_key"]}}}, "heat_template_version": "2013-05-23", "resources": {"KeyPair": {"type": "OS::Nova::KeyPair", "properties": {"name": {"get_param": "key_name"}, "save_private_key": {"get_param": "key_save"}}}}, "parameters": {"key_name": {"default": "heat_key_test", "type": "string"}, "key_save": {"default": false, "type": "string"}}} files: {} environment: {"parameter_defaults": {}, "parameters": {}, "resource_registry": {"resources": {}}} predecessor: NULL *************************** 3. row *************************** id: 3 created_at: 2015-10-14 10:38:39 updated_at: NULL template: {"outputs": {"PublicKey": {"value": {"get_attr": ["KeyPair", "public_key"]}}, "PrivateKey": {"value": {"get_attr": ["KeyPair", "private_key"]}}}, "heat_template_version": "2013-05-23", "parameters": {"key_name": {"default": "heat_key_test", "type": "string"}, "key_save": {"default": false, "type": "string"}}, "resources": {"KeyPair": {"type": "OS::Nova::KeyPair", "properties": {"name": {"get_param": "key_name"}, "save_private_key": {"get_param": "key_save"}}}}} files: {} environment: {"parameter_defaults": {}, "parameters": {}, "resource_registry": {"resources": {}}} predecessor: NULL 3 rows in set (0.00 sec) template that was used in this case: heat_template_version: 2013-05-23 parameters: key_name: type: string default: heat_key_test key_save: type: string default: false resources: KeyPair: type: OS::Nova::KeyPair properties: name: { get_param: key_name } save_private_key: { get_param: key_save } outputs: PublicKey: value: { get_attr: [KeyPair, public_key] } PrivateKey: value: { get_attr: [KeyPair, private_key] }
tested it better, thanks therve
The bug wasn't about creating extra raw_template rows, but rather about doing multiple updates (with no actual change) to an existing row. Also this test would not be sufficient to trigger the reported bug if it were present - it occurs only with Template resources (aka provider resources). There was a second issue fixed in this build that was also resulting in extra updates to the raw_template table which might have been triggered by this test, but I suspect it actually required something to be updated. The two extra rows (timestamps suggest 1 from create and 2 from update, not the other way around) are expected - Heat creates a backup stack that has its own template, and because of soft deletes it doesn't get cleaned up as soon as we'd like it to (https://bugs.launchpad.net/heat/+bug/1332300). It also writes the new template at the end of the update - there may be a minor bug here in that we're not deleting the old one, but it's unrelated to the reported bug.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2015:1901