Fixes #36835 - host applicable errata filter too slow #10770
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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?
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.