Bug 2217192

Summary: reposync and repomanage don't agree about modules and "new"
Product: Red Hat Enterprise Linux 9 Reporter: Chris Adams <linux>
Component: dnf-plugins-coreAssignee: Evan Goode <egoode>
Status: CLOSED MIGRATED QA Contact: swm-qe
Severity: unspecified Docs Contact:
Priority: low    
Version: 9.2CC: james.antill, mcurlej
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-14 09:10:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Adams 2023-06-24 23:35:21 UTC
When setting up a local mirror of the rhel-9-for-x86_64-appstream-rpms repo, I use "dnf reposync --download-metadata --newest-only". Then to clear out the old versions of packages, I followed https://access.redhat.com/solutions/4011571 (but made it "dnf repomanage"). That consistently downloads and deletes some module-related packages, such as php-common-8.1.8-1.module+el9.1.0+15877+c3862210.x86_64.rpm.

It seems that reposync's logic for --newest-only must not quite match repomanage's logic for --new.

Comment 1 Evan Goode 2023-07-10 15:56:53 UTC
Thanks for reporting! Yes, it seems reposync uses a different, slightly smarter strategy to determine which pages are "newest". This comment explains reposync's behavior: https://bugzilla.redhat.com/show_bug.cgi?id=1833074#c35. I agree, it would be nice if repomanage was consistent. But fixing this in DNF 4 is a low priority; I think it will be best if we rather keep this issue in mind when developing the reposync and repomanage plugins for DNF 5, the package manager replacing DNF in Fedora 39+.

Comment 2 Evan Goode 2023-07-10 15:58:54 UTC
I realize the linked comment is marked Red Hat internal-only. Reproducing it here:

> This is most likely expected. Let me explain how it works.

> Originally `reposync -n` downloaded two sets of packages:

> 1. non-modular packages with the highest NEVRA

> 2. all rpms from the latest versions of module streams

> But it turned out that in some cases the highest NEVRA package is not part of the latest module stream version. The reason is the change of package release format - we moved from rhnsd-0:5.0.35-3.module+el8+2754+6a08e8f4.x86_64 format (part of older module stream version) to rhnsd-0:5.0.35-3.module+el8.1.0+3455+3ddf2832.x86_64 (part of newer module stream version). Unfortunately the solver considers older module+el8+2754+6a08e8f4 release to be higher version then newer module+el8.1.0+3455+3ddf2832.

> To fix the issue we decided to add third set of downloaded packages:

> 3. all rpms from module streams that contains the packages with highest NEVRAs. Because of potential dependencies between packages in the same stream we prefer not to download only some rpms from the module stream (like only those with highest NEVRA), but we always download all its packages.

> That means that after the patch the number of downloaded packages most probably gets higher.

Comment 3 Martin Curlej 2023-08-14 09:10:05 UTC
This bug was migrated to our public Jira instance. From september this year we will stop using bugzilla for bug reporting againts RHEL related components.

The link to the jira bug can be found below:

https://issues.redhat.com/browse/RHEL-1232