Bug 1943317

Summary: Pulp3 Migration after migration reset doesn't import errata info from pulp3
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: RepositoriesAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Tasos Papaioannou <tpapaioa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: egolov, ltran
Target Milestone: 6.9.1Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.18.1.23-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-26 17:36:58 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 Justin Sherrill 2021-03-25 19:11:08 UTC
Steps:

1) sync a repo with at least one errata
2) migrate the content (foreman-maintain content prepare)
3) reset the migration   (foreman-maintain content migration-reset)
4) remigrate  (foreman-maintain content prepare)
5) check un-migrated errata:

 Katello::RepositoryErratum.where(erratum_pulp3_href: nil).count

This should be zero, but ends up being all RepositoryErratum entries.

The cause of this is this line:
<pre>
        last_migration_time = last_successful_migration_time
        offset = 0
        limit = SETTINGS[:katello][:pulp][:bulk_load_size]
        response = pulp2_content_api.list(pulp2_content_type_id: 'erratum', offset: offset, limit: limit, pulp2_last_updated__gt: last_migration_time)
</pre> 

last_successful_migration_time doesn't seem to take into account a reset action (where everything needs to be re-imported)

Comment 1 Justin Sherrill 2021-03-25 19:12:39 UTC
Created from redmine issue https://projects.theforeman.org/issues/32210

Comment 2 Justin Sherrill 2021-03-25 19:12:40 UTC
Upstream bug assigned to None

Comment 3 Bryan Kearney 2021-03-26 00:02:20 UTC
Upstream bug assigned to jsherril

Comment 4 Bryan Kearney 2021-03-26 00:02:22 UTC
Upstream bug assigned to jsherril

Comment 6 Tasos Papaioannou 2021-04-09 19:06:15 UTC
Verified on 6.9.1 snap 1.0.

Comment 11 errata-xmlrpc 2021-04-26 17:36:58 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 (Satellite 6.9.1 Async Bug Fix Update), 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/RHBA-2021:1371