Bug 1147669 - Delete orphaned configurations from rhq_configuration
Summary: Delete orphaned configurations from rhq_configuration
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: RHQ Project
Classification: Other
Component: Configuration, Database
Version: 4.12
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.13
Assignee: Thomas Segismont
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-29 19:34 UTC by Elias Ross
Modified: 2014-10-16 13:06 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-10-16 13:06:27 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1131726 0 unspecified ON_QA Data from RHQ_CONFIG_UPDATE never purged 2022-03-31 04:28:05 UTC

Internal Links: 1131726

Description Elias Ross 2014-09-29 19:34:39 UTC
Description of problem:

I have 800,000+ rows in RHQ_CONFIG and RHQ_CONFIG_PROPERTY has 87,000,000+ rows, and this is just my lab system. My suspicion is data is not being deleted here there either. 

As RHQ_RESOURCE is 150K rows, and none of the other tables come close to that many rows, there's quite a lot of orphaned configurations I suspect.

Comment 1 Elias Ross 2014-09-29 20:21:55 UTC
I have this query but it doesn't finish running (> 15 minutes)... 

select id, ctime, mtime from rhq_config
where id not in
(
select sender_config_id from rhq_alert_notification
union
select extra_config_id from rhq_alert_notification
union
select config_id from rhq_bundle_deployment
union
select configuration_id from rhq_config_group_update
-- no property
union
select config_id from rhq_config_template
union
select configuration_id from rhq_config_update
union
select configuration_id from rhq_content_source
union
select configuration_id from rhq_create_res_hist
union
select configuration_id from rhq_create_res_hist
union
select configuration_id from rhq_dashboard
union
select configuration_id from rhq_dashboard_portlet
union
select config_id from rhq_drift_definition
union
select config_id from rhq_drift_def_template
union
select deployment_config_id from rhq_installed_pkg_hist
union
select parameters_config_id from rhq_operation_history
union
select results_config_id from rhq_operation_history
union
select config_id from rhq_package_version
union
select plugin_config_id from rhq_plugin
union
select jobs_config_id from rhq_plugin
union
select config_id from rhq_raw_config
union
select res_configuration_id from rhq_resource
union
select plugin_configuration_id from rhq_resource
union
select bundle_config_id from rhq_resource_type
union
select configuration_id from rhq_subject
)

Comment 2 Thomas Segismont 2014-10-16 13:06:27 UTC
There are different reasons why this table can grow large. The most important is that as of RHQ4.12 resource config and group resource config updates are not purged.

This is addressed by Bug 1131726.

While you query is correct for RHQ4.12, there's a risk that we delete configuration objects if someone adds a new column referencing a configuration in future releases and doesn't:
* create the foreign key constraint
* update the orphaned configuration purge query

If it happens again in the future, I'd be interested to see what type of information was stored in orphaned configurations. We may be able to determine which parent object leaves some garbage.


Note You need to log in before you can comment on or make changes to this bug.