Bug 1729049

Summary: List all hosts in an organization takes long time when there is a lot of reports.
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: SCAP PluginAssignee: Hao Chang Yu <hyu>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: alexandre.chanu, anrussel, mhulan, mlele, oprazak, stefan.schwiedel, sthirugn, wclark, wpinheir
Target Milestone: 6.6.0Keywords: Patch, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: hotfix_delivered
Fixed In Version: tfm-rubygem-foreman_openscap-1.0.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 12:47:50 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:
Attachments:
Description Flags
Hotfix RPM for Satellite 6.4.4
none
Hotfix RPM for Satellite 6.5.3 none

Description Hao Chang Yu 2019-07-11 09:46:34 UTC
Description of problem:
Satellite is taking long time to load the All Host page in an organization when there is a lot of reports.

There is a default scope in "app/models/foreman_openscap/arf_report.rb"

    default_scope do
      with_taxonomy_scope do
        order("#{self.table_name}.created_at DESC")
      end
    end

With "Organization.current" set, the above function will try to filter the reports by organization. This seems to cause ruby to take long time to construct a list of report ids in an organization to be filtered when there is a lot of reports in an organization.


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


Steps to Reproduce:
1. Need to have many content hosts that run openscap scan and upload the reports to the Satellite.
2. Make sure "Any organization" is set
3. Go to Hosts -> All Hosts page
4. The page should finish loading within an acceptable time.
5. Now, set the organization.
6. Refresh the "All Hosts" page again
7. The page will take several minutes to load.

Actual results:
"All hosts" page takes long time to load

Expected results:
"All hosts" page should finish loading within an acceptable time.

Comment 5 Bryan Kearney 2019-07-23 12:01:35 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27332 has been resolved.

Comment 6 S.Schwiedel 2019-07-31 11:26:19 UTC
I don`t think that this bug solves the issue itself. 
Loading ARF report data while opening the "All Hosts" or "Content Hosts" Page doesn`t require any report data.
The mentioned foreman_openscap fix may speed up the page loading time but the loading of all reports still generate I/O and latency for data which is not really required for the page view.

Comment 8 S.Schwiedel 2019-08-07 05:16:52 UTC
The dev clarified the behavior. The status icon in the hostlist has a mouseover window with information about the compliance status. This is the reason why they load all ARF Reports in the hostlist.

Comment 12 wclark 2019-10-08 16:30:52 UTC
Created attachment 1623517 [details]
Hotfix RPM for Satellite 6.4.4

A hotfix is available for Satellite 6.4.4. Installation instructions:

1. Download attached hotfix RPM and copy it to Satellite server

2. yum localinstall /path/to/hotfix/RPM

3. # systemctl restart httpd

Comment 14 errata-xmlrpc 2019-10-22 12:47:50 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:3172

Comment 15 Mihir Lele 2019-10-29 05:45:20 UTC
Hello,

I have a customer(case 02500259) who is requesting hotfix for 6.5.

Can we have a hotfix for that too?

regards,
Mihir

Comment 16 wclark 2019-10-31 15:09:29 UTC
Created attachment 1631086 [details]
Hotfix RPM for Satellite 6.5.3

Hotfix is available for Satellite 6.5.3.

To install:

1. Take a backup or snapshot of Satellite server

2. Download Hotfix RPM for version 6.5.3 from this BZ and copy it to Satellite server

3. rpm -Uvh /path/to/hotfix/rpm

4. systemctl restart httpd