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 1428012 - [RFE] Feature to truncate trend tables
Summary: [RFE] Feature to truncate trend tables
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Trends
Version: 6.2.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Ivan Necas
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-01 17:20 UTC by Paul Armstrong
Modified: 2018-09-04 19:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 19:05:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 22767 0 Normal New Feature to truncate trend tables 2020-10-09 09:32:47 UTC

Comment 4 Marek Hulan 2017-03-02 07:59:44 UTC
There is a built-in task to clean duplicate entries that's normally run by cron. To run it manually before the upgrade, you can do following

foreman-rake trends:clean

It should lower the number of data. Note that this task was present only before 6.2. There has been a change in how we store trends data so it should consume less data since we do not store duplicate values but intervals (aka diff only). Previous data storage format is automatically converted during the upgrade. Also in 6.2 there's a rake task to reduce points in chart which might help.

foreman-rake trends:reduce

But in general I agree that there should be a clean up mechanism for old data that are no longer relevant and that should probably read the value from "Max trends" setting we have. Shim, is there something I missed? Is there a way to remove old intervals from DB?

Comment 5 Shimon Shtein 2017-03-02 15:04:34 UTC
As Marek said, in 6.2 trends are stored as intervals, which should reduce the number of records significantly. The task that converts old format (point in time) to the new one is the trends:reduce task.

Unfortunately we don't have a task that would clear old intervals from database yet. You can do it manually by running 
"foreman-rake console"
and then:

interval_end = TrendCounter.arel_table[:interval_end]
TrendCounter.where(interval_end.lt(30.days.ago)).delete_all

Before running the deletion procedure, I still recommend running

foreman-rake trends:reduce

And only if it doesn't help, start deleting old records.

Comment 6 Shimon Shtein 2018-03-05 13:07:13 UTC
Created redmine issue http://projects.theforeman.org/issues/22767 from this bug

Comment 7 Bryan Kearney 2018-09-04 18:55:26 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 8 Bryan Kearney 2018-09-04 19:05:35 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.


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