Bug 1835241 - Some applicability of the consumers are not recalculated after syncing a repository
Summary: Some applicability of the consumers are not recalculated after syncing a repo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-13 13:21 UTC by Hao Chang Yu
Modified: 2023-12-15 17:53 UTC (History)
13 users (show)

Fixed In Version: pulp-2.21.3-1
Doc Type: Known Issue
Doc Text:
Some applicability of the consumers are not recalculated after syncing a repository
Clone Of:
: 1862262 (view as bug list)
Environment:
Last Closed: 2020-10-27 13:02:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulp pull 3986 0 None closed Fix batch regenerate applicability for repo 2021-02-17 04:11:14 UTC
Pulp Redmine 6724 0 Normal CLOSED - CURRENTRELEASE Some consumer profiles are missed when calculating batch regenerate applicability for repo 2020-07-14 11:04:14 UTC
Red Hat Knowledge Base (Solution) 5195251 0 None None None 2020-07-01 13:04:27 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:02:55 UTC

Description Hao Chang Yu 2020-05-13 13:21:16 UTC
Description of problem:
Pulp calculates the applicability for repo in the batch size of 10 but the profiles of the 10th consumer in the batch will always be skipped.

For example, if you have 20 consumers, the 10th and 20th consumers will always get 0 applicability because the calculations are skipped.

Comment 3 Hao Chang Yu 2020-05-13 13:24:08 UTC
below is the offending code:


server/managers/consumer/applicability.py
                    if len(profiles_to_process) < batch_size:         <========= The last profiles in the batch is no including
                        profiles_to_process.append((repo_id, all_profiles_hash, profiles))
                    else:
                        batch_regenerate_applicability_task.apply_async(
                            (profiles_to_process,), **{'group_id': task_group_id})
                        profiles_to_process = []

Comment 4 pulp-infra@redhat.com 2020-05-27 22:04:19 UTC
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.

Comment 5 pulp-infra@redhat.com 2020-05-27 22:04:20 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 6 pulp-infra@redhat.com 2020-06-11 13:03:04 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 7 pulp-infra@redhat.com 2020-06-11 14:03:14 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 8 Pavel Moravec 2020-07-01 11:51:41 UTC
Hello,
the upstream PR refers to a regression found and fixed in 

https://github.com/pulp/pulp/pull/3990

Are both PRs required to backport, in order to properly fix this BZ?

Comment 9 Hao Chang Yu 2020-07-01 12:15:25 UTC
(In reply to Pavel Moravec from comment #8)
> Hello,
> the upstream PR refers to a regression found and fixed in 
> 
> https://github.com/pulp/pulp/pull/3990
> 
> Are both PRs required to backport, in order to properly fix this BZ?

That is the regression of Pulp 2.21.2 but Satellite 6.7.1 is using Pulp 2.21.0.1 so I think it is not affected unless someone is applying a Hotfix or something that has the regression commit.

Also see https://bugzilla.redhat.com/show_bug.cgi?id=1847019

Comment 10 pulp-infra@redhat.com 2020-07-14 11:04:15 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 11 Lai 2020-09-17 16:12:43 UTC
Steps to test.

1. Spin up and register 10 clients to the satellite.
2. Create custom animal repo and sync it
3. Sync rhel tools repo
4. Create cv and add animal repo and rhel tools repo to it.
5. Publish
6. Create an activation key with cv and lce that it's in from step 4.
7. Subscribe the prod from step 2 in the ak
8. Register 10 hosts to ak.
9. Install a downgraded version of one of the packages (I used kangaroo and/or walrus)
10. Install katello-host-tools
11. Create another custom animal repo, but do not sync it
12. Create another cv and add the new animal repo to it and publish.
13. Create a new ak with the cv and lce that it's in from step 12
14 Subscribe the prod from step 11 to ak.
15. Reregister all 10 hosts to the new ak.
16. Run 'subscription-manager refresh; subscription-manager repos --list' on all 10 hosts
17. Sync the new custom animal repo created in step 11.
18. Publish a new version of the cv created in step 12.
19. Check content hosts page

Expected:
All 10 hosts should have applicable errata count show up on the page.  If you drill into the individual host and go to the errata tab, the applicable errata should show up on the list.

Actual
All 10 hosts have applicable errata count show up on the page.  Drilling into the individual host and going to the errata tab shows the applicable errata.

Verified on 6.8.0 snap 15.

Note: the workaround to get the the count and applicable errata to show up is to run 'subscription-manager refresh; subscription-manager repos --list' on the hosts.

Comment 14 errata-xmlrpc 2020-10-27 13:02:42 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.8 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-2020:4366


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