Project

General

Profile

Bug #26365

Katello::Pool.import_all unnecessarily slow

Added by Partha Aji about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Subscriptions
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

On a scaled environment with thousands of pools, katello:import_subscriptions (called e.g. during an upgrade) does call

Katello::Pool.import_all

that traverses over each and every pool and imports hosts and namely Activation Keys from candlepin. That means, a call like:

/candlepin/owners/RedHat/activation_keys/?include=id&include=pools.pool.id

is repeatedly requested for each and every pool.

If such a request takes longer, overall upgrade time is redundantly increased.

How reproducible:
100%

Steps to Reproduce:
1. Have a system with some AKs and more pools in manifest - the more the better.

2. in one terminal:
tail -f /var/log/candlepin/candlepin.log | grep "/activation_keys/?include=id&include=pools.pool.id"

3. in 2nd terminal:
foreman-rake katello:import_subscriptions

4. count number of lines printed in the 1st terminal

Actual results:
4. shows as many logs / queries to candlepin as the number of pools is (plus one, I think).

Expected results:
4. to show just 1 or 2 such queries

Associated revisions

Revision 81191940 (diff)
Added by Partha Aji about 3 years ago

Fixes #26365 - Speeds up Pool import (#8021)

  • Fixes #26365 - Speeds up Pool import

rake katello:import subscription call wastefully gets all the
activationkeys belonging to an organization on every pool import. This
means if the user had 100 pools, one would see 100 activation key calls
for the organization.

This commit addresses that issue by simply caching the call for a few
min and there by cutting down on the network load.

  • Refs #26365 - Updated key according to PR review

History

#1 Updated by Partha Aji about 3 years ago

  • Bugzilla link set to 1683687

#2 Updated by The Foreman Bot about 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8021 added

#3 Updated by Anonymous about 3 years ago

  • Status changed from Ready For Testing to Closed

#4 Updated by Jonathon Turel about 3 years ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.12.0

Also available in: Atom PDF