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 2104401 - Improve speed of manifest refresh by running RefreshIfNeeded steps concurrently
Summary: Improve speed of manifest refresh by running RefreshIfNeeded steps concurrently
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.10.6
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: 6.12.0
Assignee: Pavel Moravec
QA Contact: Cole Higgins
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-06 07:27 UTC by Pavel Moravec
Modified: 2022-11-16 13:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:34:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35169 0 Normal Closed Improve speed of manifest refresh by running RefreshIfNeeded steps concurrently 2022-07-12 10:06:35 UTC
Red Hat Issue Tracker SAT-11426 0 None None None 2022-09-29 00:42:52 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:34:30 UTC

Description Pavel Moravec 2022-07-06 07:27:49 UTC
Description of problem:
During a manifest refresh, all enabled (Red Hat) repositories are refreshed via Actions::Pulp3::Orchestration::Repository::RefreshIfNeeded dynflow step. That step is called sequentially for each such repo.

Since pulp can easily parallelize this independent work, we shall speed up the manifest refresh by calling the dynflow steps concurrently.

To prevent some scalability issues similarly like with Capsule sync, let add concurrency of blocks of :foreman_proxy_content_batch_size tasks "only".

Proposed patch (that I will raise upstream ticket and PR later on):

--- /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.57/app/lib/actions/katello/organization/manifest_refresh.rb.orig	2022-07-06 08:42:19.026663954 +0200
+++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.57/app/lib/actions/katello/organization/manifest_refresh.rb	2022-07-06 09:08:44.345836777 +0200
@@ -42,10 +42,14 @@ module Actions
 
         def plan_refresh_repos(import_products_action, org)
           repositories = ::Katello::Repository.in_default_view.in_product(::Katello::Product.redhat.in_org(org))
-          repositories.each do |repo|
-            plan_action(Katello::Repository::RefreshRepository,
-              repo,
-              :dependency => import_products_action.output)
+          repositories.in_groups_of(Setting[:foreman_proxy_content_batch_size], false) do |repo_batch|
+            concurrence do
+              repo_batch.each do |repo|
+                plan_action(Katello::Repository::RefreshRepository,
+                  repo,
+                  :dependency => import_products_action.output)
+              end
+            end
           end
         end
 

Having 60 Red Hat repos enabled, the patch improved time of manifest refresh from 100 seconds to approx 60. (while most fo the remaining time was spent in candlepin). So improvement in tens of percents of running time can be achieved in general (depending on # of enabled RH repos).


Version-Release number of selected component (if applicable):
Sat6.10


How reproducible:
100%


Steps to Reproduce:
1. Enable (dont necessarily sync) tens of Red Hat repositories
2. Refresh manifest a few times (to have statistically significant data)
3. Check its duration and sequence/concurrency of Actions::Pulp3::Orchestration::Repository::RefreshIfNeeded steps.
4. Apply the above patch and restart services
5. Run manifest refresh a few times again


Actual results:
3. Manifest refresh triggers RefreshIfNeeded steps in sequence.
5. Evident improvement in manifest refresh duration


Expected results:
3. to have the steps running concurrently (up to some limit, like the :foreman_proxy_content_batch_size tunable).



Additional info:

Comment 1 Bryan Kearney 2022-07-06 16:05:06 UTC
Upstream bug assigned to pmoravec

Comment 2 Bryan Kearney 2022-07-06 16:05:08 UTC
Upstream bug assigned to pmoravec

Comment 3 Bryan Kearney 2022-07-08 16:04:55 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35169 has been resolved.

Comment 8 errata-xmlrpc 2022-11-16 13:34:16 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 (Important: Satellite 6.12 Release), 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-2022:8506


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