Bug 1253802

Summary: Fetching product or repo list using sync plans with large number of tasks takes minutes
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: APIAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Tazim Kolhar <tkolhar>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, chrobert, cwelton, jalviso, justin.garrison, lgraham, mmccune, omaciel, pdwyer, pmoravec, sauchter, tkolhar
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/11447
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-15 18:20:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Sherrill 2015-08-14 18:11:17 UTC
Description of problem:

Customer has 5 products enabled with: 46, 5, 2, 2 & 2 repositories in each one.  All 5 products are in the same sync plan.  There are also 141916 tasks in the ForemanTask::Task table and 549906 locks in the lock table.

Loading the products page takes about 10 minutes.  Loading the repositories page for a product takes ~5 minutes

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

How reproducible:
Always

Steps to Reproduce:
1. Populate a satellite with the above stats
2. Visit the products list and the repo list for a product


Actual results:
takes minutes to load

Expected results:
Loads fairly quickly

Additional info:

Comment 2 Justin Sherrill 2015-08-14 19:23:09 UTC

Related PR: https://github.com/theforeman/foreman-tasks/pull/129  but one we can unlikely ship with an errata/hotfix

Comment 3 Justin Sherrill 2015-08-21 20:02:19 UTC
Created redmine issue http://projects.theforeman.org/issues/11447 from this bug

Comment 4 Bryan Kearney 2015-08-24 13:35:19 UTC
Upstream bug assigned to jsherril

Comment 5 Bryan Kearney 2015-08-25 00:04:49 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/11447 has been closed
-------------
Justin Sherrill
Applied in changeset commit:katello|c320d524d7035a64a259f5bc58655dca82607740.

Comment 6 Justin Sherrill 2015-08-25 15:40:56 UTC
https://github.com/theforeman/foreman-tasks/pull/129  shouldn't actually be needed  only:  https://github.com/Katello/katello/pull/5435

Comment 9 Mike McCune 2015-09-21 23:19:22 UTC
*** HOTFIX Instructions ***


1) Ensure your system is fully updated to Satellite 6.1.2 via the latest errata:

https://access.redhat.com/errata/RHBA-2015:1786

This hotfix will not function on any prior versions.

2) On your Satellite Server, install the hotfix RPM for RHEL6 or RHEL7:

RHEL6:

$ sudo rpm -Uvh http://people.redhat.com/~mmccune/hotfix/1253802/ruby193-rubygem-katello-2.2.0.67.hotfix.1253802-1.el6_6sat.noarch.rpm

RHEL7:

$ sudo rpm -Uvh http://people.redhat.com/~mmccune/hotfix/1253802/ruby193-rubygem-katello-2.2.0.67.hotfix.1253802-1.el7sat.noarch.rpm


3) Restart services: 

# katello-service restart

4) Resume operations.

Comment 11 Tazim Kolhar 2015-10-06 11:08:53 UTC
VERIFIED:
# rpm -qa | grep foreman
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el7sat.noarch
foreman-vmware-1.7.2.40-1.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
foreman-debug-1.7.2.40-1.el7sat.noarch
foreman-proxy-1.7.2.6-1.el7sat.noarch
foreman-1.7.2.40-1.el7sat.noarch
foreman-gce-1.7.2.40-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.3-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
hp-xw6600-02.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
hp-xw6600-02.rhts.eng.bos.redhat.com-foreman-proxy-1.0-2.noarch
foreman-compute-1.7.2.40-1.el7sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.22-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.15.7-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.5-1.el7sat.noarch
foreman-libvirt-1.7.2.40-1.el7sat.noarch
foreman-postgresql-1.7.2.40-1.el7sat.noarch
hp-xw6600-02.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-ovirt-1.7.2.40-1.el7sat.noarch
foreman-selinux-1.7.2.13-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.19-1.el7sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.9-1.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch


steps:
1. Enabled 5 products:with some repositories enabled.All 5 products are in the same sync plan
2. Populate a satellite with the above stats
3. Visit the products list and the repo list for a product

was able to load faster

Comment 12 Bryan Kearney 2015-10-08 16:07:58 UTC
*** Bug 1268844 has been marked as a duplicate of this bug. ***

Comment 14 errata-xmlrpc 2015-10-15 18:20:34 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/RHBA-2015:1911