Project

General

Profile

Actions

Bug #39585

open

Host - Available Errata report generation consumes too much memory

Added by Quinn James 4 days ago. Updated 2 days ago.

Status:
Ready For Testing
Priority:
Normal
Assignee:
Category:
Reporting
Target version:
Difficulty:
hard
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

When generating the Host - Available Errata report, the template loops over each host and runs `host.applicable_errata.includes(:cves).search_for(filter)`, so we're essentially loading every host's available errata as an individual query. Since there is no deduplication, the database needs to allocate RAM for N hosts x N errata per host x N CVEs AND we are hitting the limit for query size in postgres. Please see the JIRA for actual reproducers.

The fix is to drop iteration over hosts as a part of the lookup and move that logic to inside the ActiveRecord queries. Hosts should have the same errata in a lot of cases, so it would solve the request size limit issue if we deduplicate by id as well. We should be able to join host content_facet_ids with Katello::Erratum and solve this with a few queries.

Related to: https://projects.theforeman.org/issues/39586

Actions #1

Updated by The Foreman Bot 4 days ago

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

Updated by Ian Ballou 2 days ago

  • Difficulty set to hard
  • Triaged changed from No to Yes
Actions #3

Updated by Quinn James 2 days ago

  • Description updated (diff)
Actions

Also available in: Atom PDF