Bug 1929385

Summary: pulp3: Improve migration re-run times if there were no or very little changes in pulp 2
Product: Red Hat Satellite Reporter: Tanya Tereshchenko <ttereshc>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: bmbouter, ggainey, ipanova, juwatts, pcreech, rchan, ttereshc, zhunting
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pulp-2to3-migration-0.8.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:10:34 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 Tanya Tereshchenko 2021-02-16 18:47:54 UTC
Description of problem:


### Motivation
Users run the migration task multiple times upfront, so the switchover to Pulp 3 happens quickly.
Switchover = stop pulp 2 services, run migration for the last time, start using pulp3.

### Existing concerns and thoughts

 * Following the same code path as normal migration when no changes have been made in pulp 2 takes a noticeable amount of time. We might need to introduce some shortcuts for the case when nothing has been changed in pulp 2.
 * Same goes to the case when only very few changes have been made.
 * If everything possible is done and no shortcuts are available we might need to look at the performance of the longest steps or rethink the approach.


Currently success depends on the amount of repositories (and not on content if it hasn't changed). The more Pulp 2 repositories are being migrated, the worse performance is. Dogfood has 40K repos, and re-run takes hours.

Comment 1 pulp-infra@redhat.com 2021-02-16 19:04:54 UTC
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.

Comment 2 pulp-infra@redhat.com 2021-02-16 19:04:55 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 3 pulp-infra@redhat.com 2021-02-18 17:20:41 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 4 pulp-infra@redhat.com 2021-02-18 18:06:57 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 5 pulp-infra@redhat.com 2021-02-18 21:06:03 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 7 Lai 2021-03-12 20:31:09 UTC
Steps to test:

1. Sync a couple small RH repos
2. Create cv and add repos from 1 to it
3. Publish
4. Run Migration
5. Once migration is completed, run migration again with no changes.
6. Once migration is completed, remove 1 repo from cv and republish.
7. Run migration again.

Expected result:
4. Should take the longest amount of time to finish
5. Should take the least amount of time to finish
7. Should take a few minutes to finish

Actual result:
4. Took 20 minutes to finish
5. Took under a minute to finish
7. Took ~3 minutes to finish

These were all done with a couple of small RH repos.  The run time can be seen under task.

python3-pulp-2to3-migration-0.9.1-1.el7pc.noarch

Verified on 6.9.0_017

Comment 10 errata-xmlrpc 2021-04-21 13:10:34 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 (Moderate: Satellite 6.9 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-2021:1313