Bug 1317458

Summary: heat-manage purge_deleted deletes only some data
Product: Red Hat OpenStack Reporter: Ondrej <ochalups>
Component: openstack-heatAssignee: Thomas Hervé <therve>
Status: CLOSED NOTABUG QA Contact: Amit Ugol <augol>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: cwolfe, jruzicka, mbayer, mburns, ochalups, rhel-osp-director-maint, sbaker, shardy, yeylon, zbitter
Target Milestone: ---   
Target Release: 8.0 (Liberty)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-17 13:13:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ondrej 2016-03-14 10:03:23 UTC
Description of problem:
Running heat-manage purge_deleted deletes only part of the data,
keeping a lot of useless data (heat.raw_template).

MariaDB [heat]> SELECT      table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES  WHERE table_schema = "heat"     AND table_name = "raw_template";
+--------------+------------+
| Table        | Size in MB |
+--------------+------------+
| raw_template |    3240.69 |
+--------------+------------+

#heat-manage purge_deleted

MariaDB [heat]> SELECT      table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES  WHERE table_schema = "heat"     AND table_name = "raw_template";
+--------------+------------+
| Table        | Size in MB |
+--------------+------------+
| raw_template |    1816.08 |
+--------------+------------+


Version-Release number of selected component (if applicable):
openstack-heat-api.noarch 2015.1.2-9.el7ost                                
openstack-heat-api-cfn.noarch 2015.1.2-9.el7ost                               
openstack-heat-api-cloudwatch.noarch 2015.1.2-9.el7ost                                
openstack-heat-common.noarch 2015.1.2-9.el7ost                                
openstack-heat-engine.noarch 2015.1.2-9.el7ost                                
openstack-heat-templates.noarch 0-0.8.20150605git.el7ost

How reproducible:


Steps to Reproduce:
1. heat-manage purge_deleted
2.
3.

Actual results:
keeps some data

Expected results:
purge all, raw_template keeps thousands of entries

Additional info:

Comment 2 Michael Bayer 2016-03-14 13:50:02 UTC
this issue would be within the heat application itself, which is responsible for emitting the appropriate SQL to the database in order to delete the items.  Only if it could be shown that this issue reproduces *only* when galera is in play, and not when plain mariadb is in use, would that even suggest the possibility of the issue being part of mariadb-galera and even then it still would likely be an issue in heat.    If the purge_deleted command has issues there's likely an upstream issue for heat in launchpad already.

Comment 3 Michael Bayer 2016-03-14 13:51:34 UTC
better component

Comment 4 Zane Bitter 2016-03-14 15:49:35 UTC
By default (i.e. with no arguments passed to heat-manage, as indicated in the description) only stacks that were deleted more than 90 days ago are purged. Are you certain that every stack was deleted more than 90 days ago? If not then completely clearing the table is definitely not the expected result. Have you tried with a shorter horizon to see if that removes more data?

Comment 5 Ondrej 2016-03-17 10:28:31 UTC
Hi,
thx Zane, that did the trick, my bad i must have overlooked the flag, sorry.