Issue #6950
closedMigration of a distribution tree fails when it is present in multiple repos
Description
Jun 10 12:04:46 pulp2-nightly-pulp3-source-centos7.fluffy.example.com rq[1704]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
Jun 10 12:04:46 pulp2-nightly-pulp3-source-centos7.fluffy.example.com rq[1704]: return getattr(self.get_queryset(), name)(*args, **kwargs)
Jun 10 12:04:46 pulp2-nightly-pulp3-source-centos7.fluffy.example.com rq[1704]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 412, in get
Jun 10 12:04:46 pulp2-nightly-pulp3-source-centos7.fluffy.example.com rq[1704]: (self.model._meta.object_name, num)
Jun 10 12:04:46 pulp2-nightly-pulp3-source-centos7.fluffy.example.com rq[1704]: pulp_2to3_migration.app.models.repository.Pulp2RepoContent.MultipleObjectsReturned: get() returned more than one Pulp2RepoContent -- it returned 2!
Jun 10 12:04:47 pulp2-nightly-pulp3-source-centos7.fluffy.example.com rq[1704]: pulp: pulp_rpm.app.tasks.publishing:INFO: Publishing: repository=kickstart-repo, version=0
Jun 10 12:04:47 pulp2-nightly-pulp3-source-centos7.fluffy.example.com rq[1704]: pulp: pulp_rpm.app.tasks.publishing:INFO: Publishing: repository=kickstart-repo1, version=0
Steps to reproduce:
- create repo1 with kickstart tree, sync
- create repo2 and copy content from repo1. publish it
- run the migration
Related issues
Updated by ipanova@redhat.com over 4 years ago
- Subject changed from Re-migration of a distribution tree fails when it is present in multiple repos to Migration of a distribution tree fails when it is present in multiple repos
Updated by ttereshc over 4 years ago
The affected line https://github.com/pulp/pulp-2to3-migration/blob/e89b4d47b1ec42bf8bc1d16bda2a2c12bec4032c/pulp_2to3_migration/app/plugin/rpm/pulp_2to3_models.py#L725
Because a distribution tree depends on a repo it belongs to, it might be needed to take a repository into consideration at pre-migration time. Similar to how it's done for errata. E.g. if the same erratum is in 2 repos, there will be two records in the pre-migration table Pulp2Content. One - for each repo, a repo is a part of uniqueness constraint. This way we'll know which repo to choose at the step where the current failure is happening.
For the first repo, everything will go smoothly. Now there is a new challenge, what to do for the second repo?
- Do we create a new distribution tree which differs only in its relation to the repo? (I'm not sure if it's even possible with the current model in RPM)
- do we somehow assign the same DistributionTree content unit to a different repo?
The solution might be dependent on the fix for the #7046.
Updated by ttereshc over 4 years ago
- Related to Issue #7046: Adding a distribution tree to another repo doesn't work correctly added
Updated by ttereshc over 4 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ttereshc
Updated by ttereshc over 4 years ago
- Related to Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant added
Added by ttereshc over 4 years ago
Added by ttereshc over 4 years ago
Revision a62800bb | View on GitHub
Fix distribution tree migration due to recent changes in the RPM plugin.
Also fixes the case when a distribution tree is present in multiple repos.
Added by ttereshc over 4 years ago
Revision a62800bb | View on GitHub
Fix distribution tree migration due to recent changes in the RPM plugin.
Also fixes the case when a distribution tree is present in multiple repos.
Updated by ttereshc over 4 years ago
- Status changed from ASSIGNED to MODIFIED
Applied in changeset pulp:pulp-2to3-migration|a62800bb38c6a76a6047cd0c715ed5a39a48f7e5.
Added by ttereshc over 4 years ago
Revision 6e39ce34 | View on GitHub
Fix distribution tree migration due to recent changes in the RPM plugin.
Also fixes the case when a distribution tree is present in multiple repos.
closes #7206 https://pulp.plan.io/issues/7206
closes #6950 https://pulp.plan.io/issues/6950
(cherry picked from commit a62800bb38c6a76a6047cd0c715ed5a39a48f7e5)
Added by ttereshc over 4 years ago
Revision 6e39ce34 | View on GitHub
Fix distribution tree migration due to recent changes in the RPM plugin.
Also fixes the case when a distribution tree is present in multiple repos.
closes #7206 https://pulp.plan.io/issues/7206
closes #6950 https://pulp.plan.io/issues/6950
(cherry picked from commit a62800bb38c6a76a6047cd0c715ed5a39a48f7e5)
Added by ttereshc over 4 years ago
Revision 6e39ce34 | View on GitHub
Fix distribution tree migration due to recent changes in the RPM plugin.
Also fixes the case when a distribution tree is present in multiple repos.
closes #7206 https://pulp.plan.io/issues/7206
closes #6950 https://pulp.plan.io/issues/6950
(cherry picked from commit a62800bb38c6a76a6047cd0c715ed5a39a48f7e5)
Updated by ttereshc over 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Fix distribution tree migration due to recent changes in the RPM plugin.
Also fixes the case when a distribution tree is present in multiple repos.
closes #7206 https://pulp.plan.io/issues/7206
closes #6950 https://pulp.plan.io/issues/6950