Bug 1549123

Summary: Targeted refresh targets can grow unbounded causing Postgres InternalError
Product: Red Hat CloudForms Management Engine Reporter: Matouš Mojžíš <mmojzis>
Component: ProvidersAssignee: Ladislav Smola <lsmola>
Status: CLOSED ERRATA QA Contact: Matouš Mojžíš <mmojzis>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9.0CC: cpelland, gblomqui, jfrey, jhardy, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ec2:openstack:refresh
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-07 23:01:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:

Description Matouš Mojžíš 2018-02-26 12:57:42 UTC
Description of problem:
Same issue as in BZ linked below except for targeted refresh targets.
https://bugzilla.redhat.com/show_bug.cgi?id=1517962

Version-Release number of selected component (if applicable):
5.9.0.21

How reproducible:
Always

Steps to Reproduce:
1.Add ec2 or openstack provider
2.Stop provider inventory role
3.Run command in rails console:
irb(main):001:0> ems = ExtManagementSystem.first; 2_000.times { ems.refresh_ems }; 
irb(main):002:0* MiqQueue.find_by(:class_name => "EmsRefresh", :method_name => "refresh", :queue_name => ems.queue_name).data.count
Result of this command should be always under 1k.

Actual results:


Expected results:


Additional info:

Comment 3 CFME Bot 2018-03-13 16:51:41 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/a22c7afc1a3957b024de903b9c11c72513c3ab22
commit a22c7afc1a3957b024de903b9c11c72513c3ab22
Author:     Ladislav Smola <lsmola>
AuthorDate: Tue Mar 13 10:06:33 2018 -0400
Commit:     Ladislav Smola <lsmola>
CommitDate: Tue Mar 13 10:06:33 2018 -0400

    Stop unbounded growth of targets

    Stop unbounded growth of targets

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

 app/models/ems_refresh.rb | 8 +-
 spec/models/ems_refresh_spec.rb | 50 +
 2 files changed, 57 insertions(+), 1 deletion(-)

Comment 4 Matouš Mojžíš 2018-08-07 14:02:39 UTC
Verified in 5.10.0.8. 
After running these commands and checking count for two days with second command:
irb(main):001:0> ems = ExtManagementSystem.first; 2_000.times { ems.refresh_ems }; 
irb(main):002:0* MiqQueue.find_by(:class_name => "EmsRefresh", :method_name => "refresh", :queue_name => ems.queue_name).data.count

count was never over 1k.

Comment 5 errata-xmlrpc 2019-02-07 23:01:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:0212