Issue #6062
closedMigration doesn't handle repos that are removed and then re-created
Description
If i generate a migration plan with some set of repositories, then one is removed in pulp2, and recreated with the same pulp_id. If i then re-run the exact same migration plan, pulp3 will error with this:
Traceback (most recent call last):
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 822, in perform_job
rv = job.perform()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 605, in perform
self._result = self._execute()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 611, in _execute
return self.func(*self.args, **self.kwargs)
File "/usr/local/lib/pulp/src/pulp/pulp_2to3_migration/app/tasks/migrate.py", line 116, in migrate_from_pulp2
loop.run_until_complete(migrate_distributors(plan))
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "/usr/local/lib/pulp/src/pulp/pulp_2to3_migration/app/migration.py", line 205, in migrate_distributors
migrated_repo = Pulp2Repository.objects.get(pulp2_repo_id=repo_id)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 412, in get
(self.model._meta.object_name, num)
pulp_2to3_migration.app.models.repository.Pulp2Repository.MultipleObjectsReturned: get() returned more than one Pulp2Repository -- it returned 2!
Traceback (most recent call last):
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 822, in perform_job
rv = job.perform()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 605, in perform
self._result = self._execute()
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 611, in _execute
return self.func(*self.args, **self.kwargs)
od.27017[2028]: [conn229] end connection 127.0.0.1:41024 (39 connections now open)
File "/usr/local/lib/pulp/src/pulp/pulp_2to3_migration/app/tasks/migrate.py", line 116, in migrate_from_pulp2
loop.run_until_complete(migrate_distributors(plan))
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "/usr/local/lib/pulp/src/pulp/pulp_2to3_migration/app/migration.py", line 205, in migrate_distributors
migrated_repo = Pulp2Repository.objects.get(pulp2_repo_id=repo_id)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 412, in get
(self.model._meta.object_name, num)
pulp_2to3_migration.app.models.repository.Pulp2Repository.MultipleObjectsReturned: get() returned more than one Pulp2Repository -- it returned 2!
If you have trouble re-creating the issue, i can try to nail down exact steps, but it should be something like:
1. create a file repo in pulp2
2. Run a migration plan like:
{
"plugins":[
{
"type":"iso",
"repositories":[
{
"name":"5b08c8a6-d3bb-41af-9cd4-cadf8fec2a55",
"repository_versions":[
{
"pulp2_repository_id":"5b08c8a6-d3bb-41af-9cd4-cadf8fec2a55",
"pulp2_distributor_repository_ids":[
"5b08c8a6-d3bb-41af-9cd4-cadf8fec2a55"
]
}
],
"pulp2_importer_repository_id":"5b08c8a6-d3bb-41af-9cd4-cadf8fec2a55"
}
]
}
]
}
3. delete the repo in pulp2, recreate it with the exact same pulp_id for importers and distributors.
4. re-run the migration plan
Updated by ipanova@redhat.com almost 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ipanova@redhat.com
- Sprint set to Sprint 65
Updated by ipanova@redhat.com almost 5 years ago
- Status changed from ASSIGNED to POST
Added by ipanova@redhat.com almost 5 years ago
Added by ipanova@redhat.com almost 5 years ago
Revision f3d5f962 | View on GitHub
Handle case when repos are removed and re-created.
closes #6062
Added by ipanova@redhat.com almost 5 years ago
Revision f3d5f962 | View on GitHub
Handle case when repos are removed and re-created.
closes #6062
Updated by ipanova@redhat.com almost 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp:pulp-2to3-migration|f3d5f962483da352b043a61efdea673afaa4a7f9.
Updated by ipanova@redhat.com almost 5 years ago
- Description updated (diff)
- Triaged changed from No to Yes
Updated by ipanova@redhat.com almost 5 years ago
Applied in changeset pulp-2to3-migration|f3d5f962483da352b043a61efdea673afaa4a7f9.
Updated by ipanova@redhat.com almost 5 years ago
Applied in changeset pulp:pulp-2to3-migrate|f3d5f962483da352b043a61efdea673afaa4a7f9.
Updated by ttereshc over 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Updated by ggainey over 4 years ago
- Tags Katello added
- Tags deleted (
Katello-P2)
Handle case when repos are removed and re-created.
closes #6062