Project

Profile

Help

Issue #6950

Migration of a distribution tree fails when it is present in multiple repos

Added by ipanova@redhat.com over 1 year ago. Updated about 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Quarter:

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:

  1. create repo1 with kickstart tree, sync
  2. create repo2 and copy content from repo1. publish it
  3. run the migration

Related issues

Related to RPM Support - Issue #7046: Adding a distribution tree to another repo doesn't work correctlyCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to RPM Support - Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant CLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision a62800bb View on GitHub
Added by ttereshc over 1 year ago

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

Revision a62800bb View on GitHub
Added by ttereshc over 1 year ago

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

Revision a62800bb View on GitHub
Added by ttereshc over 1 year ago

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

Revision 6e39ce34 View on GitHub
Added by ttereshc over 1 year ago

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)

Revision 6e39ce34 View on GitHub
Added by ttereshc over 1 year ago

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)

Revision 6e39ce34 View on GitHub
Added by ttereshc over 1 year ago

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)

History

#1 Updated by ipanova@redhat.com over 1 year 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

#2 Updated by ttereshc over 1 year ago

  • Sprint/Milestone set to 0.2.0

#3 Updated by ttereshc over 1 year ago

  • Triaged changed from No to Yes

#4 Updated by ttereshc over 1 year ago

  • Priority changed from Normal to High

#5 Updated by ttereshc over 1 year 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.

#6 Updated by ttereshc over 1 year ago

  • Related to Issue #7046: Adding a distribution tree to another repo doesn't work correctly added

#7 Updated by jsherril@redhat.com over 1 year ago

  • Tags Katello added

#8 Updated by ttereshc over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ttereshc

#9 Updated by ttereshc over 1 year ago

  • Related to Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant added

#10 Updated by ttereshc over 1 year ago

  • Status changed from ASSIGNED to MODIFIED

#11 Updated by ttereshc about 1 year ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF