Project

Profile

Help

Issue #6950

closed

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

Added by ipanova@redhat.com over 4 years ago. Updated over 4 years 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 - CURRENTRELEASEActions
Related to RPM Support - Task #7150: Do not have FK pointing to a main repo from a DistributionTree Variant CLOSED - CURRENTRELEASEttereshc

Actions
Actions #1

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
Actions #2

Updated by ttereshc over 4 years ago

  • Sprint/Milestone set to 0.2.0
Actions #3

Updated by ttereshc over 4 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by ttereshc over 4 years ago

  • Priority changed from Normal to High
Actions #5

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.

Actions #6

Updated by ttereshc over 4 years ago

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

Updated by jsherril@redhat.com over 4 years ago

  • Tags Katello added
Actions #8

Updated by ttereshc over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ttereshc
Actions #9

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

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.

closes #7206 https://pulp.plan.io/issues/7206

closes #6950 https://pulp.plan.io/issues/6950

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.

closes #7206 https://pulp.plan.io/issues/7206

closes #6950 https://pulp.plan.io/issues/6950

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.

closes #7206 https://pulp.plan.io/issues/7206

closes #6950 https://pulp.plan.io/issues/6950

Actions #10

Updated by ttereshc over 4 years ago

  • Status changed from ASSIGNED to MODIFIED

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)

Actions #11

Updated by ttereshc over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF