Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36835 - host applicable errata filter too slow #10770

Merged

Conversation

ianballou
Copy link
Member

What are the changes introduced in this pull request?

Makes the errata returned by self.applicable_to_hosts distinct so that fewer records are returned. In one case, where a user had 10,000 hosts but only 7000 applicable errata, self.applicable_to_hosts returned over a million errata records with many duplicates.

This caused the following command to timeout due to too much processing on the web server:

hammer erratum list --errata-restrict-applicable 1 ...

Considerations taken when implementing this change?

There may have been other approaches for taking care of the timeouts, but this seemed to be the most impactful

What are the testing steps for this pull request?

  1. Register some hosts and ensure they have applicable errata.
  2. Run hammer erratum list --errata-restrict-applicable 1 ... and ensure that the returned list makes sense.
    -> I don't think it's feasible to test with a massive installation, so checking for correctness on the output should be good enough.
    -> Bonus points if you want to do a quick check of the performance of the query with and without the distinctness.

@ianballou
Copy link
Member Author

[test katello]

@ianballou
Copy link
Member Author

The test pipeline is having a hard time.

@ianballou
Copy link
Member Author

[test katello]

Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Katello::Erratum.applicable_to_hosts(::Host.all) now returns distinct errata records. Code makes sense. Ack 👍🏼

@ianballou ianballou merged commit 2653d8c into Katello:master Oct 31, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants