Project

Profile

Help

Issue #8329

closed

pulp2content can have duplicate entries under certain re-migration conditions

Added by ttereshc over 3 years ago. Updated over 3 years ago.

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

Description

Pulp2Content model has a FK to Pulp2Repository as a part of the uniqueness constraint on the model.
The FK can be null, because it is set only for content types which depend on a repo and can be associated only with one of them. Since each null is unique, it creates duplicated entries, if something changed about this content in pulp2.

To reproduce

  • migrate pulp2 rpm on_demand content
  • download that content in pulp2
  • run migration again

Solution

  • Remove FK from the uniqueness constraint
  • FOR ERRATA ONLY: set pulp2_subuid to a repo_id value where an FK to a repo has been set
  • this will maintain the necessary uniqueness for errata
  • subuid is currently only used by deb-migration
  • data migration is needed
  • find the dups; keep the one with the most-recent pulp2_last_updated, delete the others
  • for all pulp2_content_type_id=errata in pulp_2to3_migration_pulp2content, set pulp2_subid = pulp2_repo_id

Also available in: Atom PDF