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 2226567 - Slow "Katello::Applicability::Hosts::BulkGenerate" task when the host has many installed modular packages
Summary: Slow "Katello::Applicability::Hosts::BulkGenerate" task when the host has man...
Keywords:
Status: CLOSED DUPLICATE of bug 2203077
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Errata Management
Version: 6.13.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-26 01:12 UTC by Hao Chang Yu
Modified: 2023-10-20 15:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-10-20 15:24:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-20766 0 None None None 2023-10-13 14:46:09 UTC

Description Hao Chang Yu 2023-07-26 01:12:58 UTC
Description of problem:
The calculation of errata applicability takes long time to complete. It will take 5 to 10 minutes to calculate if the host has thousands of installed modular packages.


How reproducible:
Easy

Steps to Reproduce:
1. Prepare a RHEL 8 client and register it to the Satellite.
2. Enable the appstream repository.
3. Enable and install as many module streams as possible.
4. After that force upload the package profile to the Satellite to trigger the  "Katello::Applicability::Hosts::BulkGenerate" task.


Actual results:
~~~
Label: Actions::Katello::Applicability::Hosts::BulkGenerate
Status: stopped
Result: success
...
2: Actions::Katello::Applicability::Hosts::BulkGenerate (success) [ 193.02s / 193.02s ]

Queue: hosts_queue
Started at: 2023-07-05 00:14:14 UTC
Ended at: 2023-07-05 00:17:27 UTC
Real time: 193.02s
Execution time (excluding suspended state): 193.02s
~~~

Expected results:
should at least take second to complete.

Additional info:

We can use the following rake script to test the peformance.
~~~
cat << EOF | foreman-rake console
cf = Host.find(XXXX).content_facet
bound_repos = cf.bound_repositories.collect {|repo| repo.library_instance_id.nil? ? repo.id : repo.library_instance_id}
helper = Katello::Applicability::ApplicableContentHelper.new(cf, ::Katello::Rpm, bound_repos)
helper.fetch_enabled_module_stream_ids.size
Benchmark.measure {p helper.locked_modular_installed_packages(helper.fetch_enabled_module_stream_ids).size}
EOF
~~~

Example output of the rake
~~~
...
helper.fetch_enabled_module_stream_ids.size
442
Benchmark.measure {p helper.locked_modular_installed_packages(helper.fetch_enabled_module_stream_ids).size}
3021
#<Benchmark::Tms:0x0000000014c0e4a0 @label="", @real=114.56473832399934, @cstime=0.0, @cutime=0.0, @stime=0.017389999999998906, @utime=1.518035999999995, @total=1.535425999999994>
~~~


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