Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1429660 - [RFE] Need to automatically remove completed tasks from the database
Summary: [RFE] Need to automatically remove completed tasks from the database
Keywords:
Status: CLOSED DUPLICATE of bug 1384548
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Tasks Plugin
Version: 6.2.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-06 19:28 UTC by Mike McCune
Modified: 2017-08-22 10:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-22 10:19:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mike McCune 2017-03-06 19:28:49 UTC
Over time the amount of data in the foreman_tasks* and dynflow* tables can grow very large and cause significant performance issues for Satellite 6. This is most often found via rhsm calls taking longer than expected and causing Passenger and the UI becoming unable to service new requests on Satellites that meet the following criteria:

 * Have 5000 or more live hosts
 * Have been running for more than 6 months

In extreme cases we can get into the multi-million row counts (most I've seen is 6,000,000 rows in dynflow_steps) for these tables with multi-year old Satellites.

We need to ship a cron or some other time based mechanism to automatically remove tasks older than a certain time period, 120 days perhaps to start with but tunable to something smaller. 

This ideally would get included in both 6.1 and 6.2

Comment 1 Mike McCune 2017-03-06 19:29:11 UTC
We often have to resort to raw sql to delete old data, see:

https://gist.github.com/mccun934/0ce3148dbc3c388252d7210659b7c2ea

Comment 5 Adam Ruzicka 2017-08-22 10:19:55 UTC

*** This bug has been marked as a duplicate of bug 1384548 ***


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