Story #6375
closedAs a user, I can track Remotes and not remigrate them on every run
100%
Description
Motivation¶
Currently, Remotes are recreated on every run. When Remotes are removed, RemoteArtifacts are removed as well. We sent through the content migration pipeline all the content on every run only to recreate RemoteArtifacts. We need a way to minimise the amount of content which goes through the pipeline during migration re-run. If there are no changes in pulp2, almost no content should go through the migration pipeline.
Proposal¶
Track Remotes, if they were changed or not. Track any lazy catalog changes, were there any updates or not. Recreate Remotes only if needed. Recreate RemoteArtifacts only for the affected content.
Track Remotes, recreate Remotes only if needed.¶
This commit removed some initial attempts to track the Remotes, see the deletion in mark_removed_resources
and pre_migrate_*
.
- Pulp2Importer model for pre-migration needs a new field
not_in_plan
- Update
not_in_plan
accordingly in themark_removed_resources
step - When pre-migrating an importer, determine if there were any changes and mark it by setting
is_migrated
to False - When pre-migrating an importer, If there are changes to the feed or any configuration which is available on RemoteArtifact, remove such Remote from pulp3
- At the migration step, update a Remote for each Pulp2Importer which has
pulp3_remote
butis_migrated=False
- At the migration step create a Remote for each Pulp2Importer which has no
pulp3_remote
Track any lazy catalog changes¶
- Move
pre_migrate_all_content
step to happen before any importers are migrated to Pulp 3 - Pulp2LazyCatalog needs a new field
is_migrated
- At pre-migration time
is_migrated
field should be set - At pre-migration time, check if the lazy catalog entry is for the Pulp2Importer which has
pulp3_remote
or not.- If a Remote exists, it means it hasn't changed or the changes were not critical enough to recreate it, thus lazy catalog for this importer is already migrated, set
is_migrated=True
.
- If a Remote exists, it means it hasn't changed or the changes were not critical enough to recreate it, thus lazy catalog for this importer is already migrated, set
- At content migration time
is_migrated
will help to identify whether we need to create RemoteArtifacts for content or not
Recreate RemoteArtifacts only for the affected content¶
- At content migration stage, determine which migrated Pulp2Content (aka it has
pulp3content
) needs RemoteArtifact creation by querying pre-migrated lazy catalog entires which areis_migrated=False
- Create RemoteArtifatcs for those either by sending the content through the content migration pipeline or by explicitly creating RemoteArtifatcs for them
- Pulp2Content which has no
pulp3content
needs to be migrated fully - I think mutable content will be handled properly because if it changed new Pulp2Content is created and old records a re removed
Updated by ipanova@redhat.com almost 5 years ago
I think mutable content will be handled properly because if it changed new Pulp2Content is created and old records a re removed
That's correct. We remove Pulp2Content and re-create a new one https://github.com/pulp/pulp-2to3-migration/blob/master/pulp_2to3_migration/app/pre_migration.py#L133
Updated by dalley almost 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
Updated by dalley over 4 years ago
- Status changed from ASSIGNED to NEW
- Assignee deleted (
dalley)
Updated by ipanova@redhat.com over 4 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ipanova@redhat.com
- Sprint set to Sprint 71
Added by ipanova@redhat.com over 4 years ago
Added by ipanova@redhat.com over 4 years ago
Revision 01ef5a3a | View on GitHub
As a user, I can track Remotes and not remigrate them on every run
Added by ipanova@redhat.com over 4 years ago
Revision 01ef5a3a | View on GitHub
As a user, I can track Remotes and not remigrate them on every run
Updated by ipanova@redhat.com over 4 years ago
- Status changed from ASSIGNED to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp:pulp-2to3-migration|01ef5a3ad363526ae4c31c5c23dd1074ca0dea3b.
Updated by ttereshc over 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
As a user, I can track Remotes and not remigrate them on every run
closes #6375 https://pulp.plan.io/issues/6375