Bug 2101579

Summary: Retain packages on Repository removes RPMs from Pulp but not from Katello
Product: Red Hat Satellite Reporter: Ian Ballou <iballou>
Component: RepositoriesAssignee: Samir Jha <sajha>
Status: CLOSED ERRATA QA Contact: Cole Higgins <chiggins>
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: admin, ahumbe, pcreech, sajha
Target Milestone: 6.12.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-4.5.0.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-16 13:34:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Ballou 2022-06-27 21:30:37 UTC
Community post: https://community.theforeman.org/t/pulp3-yum-repo-off-by-one-retain-package-count-with-additive-mirroring-policy/29131

If a repo is synced with additive, the retain package version amount is lowered, and then the repo is synced again, RPMs will be removed from the Pulp repo but Katello will not disassociate the related Rpm records.

To reproduce:

1) Sync https://fixtures.pulpproject.org/rpm-with-modules/
  -> Additive, Retain package versions 3
2) Change retain package versions to 2
3) Perform a complete sync
4) Check the RPM count in Katello. It should not go down.
5) Check the RPM count in Pulp. It should be lower.

Comment 1 Ian Ballou 2022-06-27 21:30:41 UTC
Created from redmine issue https://projects.theforeman.org/issues/35120

Comment 2 Ian Ballou 2022-06-27 21:30:42 UTC
Upstream bug assigned to None

Comment 3 Ian Ballou 2022-06-27 21:43:09 UTC
Discovered in Katello 4.4.  Attach to the next version of Satellite after 6.11.

Comment 5 Bryan Kearney 2022-08-16 16:04:44 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35120 has been resolved.

Comment 11 Ian Ballou 2022-10-04 16:16:49 UTC
Verified!

Steps to reproduce:

1) Sync RHEL 8 BaseOS and check that packages have more than one version
2) Set the mirroring policy to "Additive" and restrict one version of packages
3) Run a complete sync on the repository
4) See that, now, only one version of RPMs exist in the repository
5) Create a content view that has the BaseOS repository
6) Create an RPM filter on the content view that includes all RPMS
7) See that the content view publish succeeds.

(I added the content view steps because there was always a chance with this BZ that the wrongly-associated RPMs would cause a 404 from Pulp at copy time)

Comment 15 errata-xmlrpc 2022-11-16 13:34:13 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.12 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-2022:8506