Bug 1767808 - [RFE] Add purging of compliances
Summary: [RFE] Add purging of compliances
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.11.1
Assignee: drew uhlmann
QA Contact: Jaroslav Henner
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On: 1733641
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-01 13:16 UTC by Satoe Imaishi
Modified: 2019-12-13 15:17 UTC (History)
9 users (show)

Fixed In Version: 5.11.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1733641
Environment:
Last Closed: 2019-12-13 15:17:52 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
pm-rhel: cfme-5.11.z+


Attachments (Terms of Use)

Comment 2 CFME Bot 2019-11-01 19:32:55 UTC
New commit detected on ManageIQ/manageiq/ivanchuk:

https://github.com/ManageIQ/manageiq/commit/7a50e8eba2eebcea1e8a26e8afab989353d6feb2
commit 7a50e8eba2eebcea1e8a26e8afab989353d6feb2
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Tue Sep 10 09:28:14 2019 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Tue Sep 10 09:28:14 2019 -0400

    Merge pull request #19264 from d-m-u/schedule_compliance_purge_or_whatever

    Schedule compliance purging

    (cherry picked from commit 87935ce0e85cad7dd6f9554136fdc5f69f200d12)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1767808

 app/models/compliance.rb | 1 +
 app/models/compliance/purging.rb | 24 +
 app/models/miq_schedule_worker/jobs.rb | 4 +
 app/models/miq_schedule_worker/runner.rb | 5 +
 config/settings.yml | 5 +
 spec/models/compliance/purging_spec.rb | 54 +
 6 files changed, 93 insertions(+)


https://github.com/ManageIQ/manageiq/commit/737ae1f8f8bf5ab301e5c6f394a0876a03c83ed1
commit 737ae1f8f8bf5ab301e5c6f394a0876a03c83ed1
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Tue Sep 24 14:21:27 2019 -0400
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Tue Sep 24 14:21:27 2019 -0400

    Merge pull request #19326 from agrare/fix_compliance_purge_timer_exception

    Fix an exception calling compliance_purge_timer

    (cherry picked from commit 14e2cf0fe1c87001ab3210cb501481357741a7fb)

    https://bugzilla.redhat.com/show_bug.cgi?id=1767808

 app/models/miq_schedule_worker/runner.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 3 Jaroslav Henner 2019-12-10 11:49:03 UTC
I created 40e3 Compliances using the rails console (I did set the timestamp to current time). I changed the compliance_purge_interval to one 1.minutes (not sure this was necessary). Then I advanced the time by six months to the future (with crhonyd disabled). The created Compliance objects disappeared quite instantly and I see this in evm.log:

workManager::EventCatcher::Runner#start_event_monitor) EMS [env-rhv43-mgr.cfme2.lab.eng.rdu2.redhat.com] as [admin@internal] Started Event Monitor Thread
[----] I, [2020-06-11T00:01:40.438265 #13115:2b1f616945b4]  INFO -- : MIQ(Compliance.purge_in_batches) Purging 10000 Compliances.
[----] I, [2020-06-11T00:01:41.107928 #13115:2b1f616945b4]  INFO -- : MIQ(Compliance.purge_in_batches) Purging 10000 Compliances.
[----] I, [2020-06-11T00:01:41.710322 #13115:2b1f616945b4]  INFO -- : MIQ(Compliance.purge_by_date) Purging Compliances older than [2019-12-11 13:07:00 UTC]...Complete - Deleted 40000 records


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