Project

Profile

Help

Issue #3130

closed

Upgrade from Pulp 2.13.2- to Pulp 2.13.3+ can result in "duplicate key error index: pulp_database.erratum_pkglists.$errata_id_1_repo_id_1 dup key"

Added by ttereshc about 7 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.13.3
Platform Release:
2.15.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 28
Quarter:

Description

0040_errata_pkglist_collection.py migration is not safe to re-run if it failed (or was interrupted) for some reason.
Getting E11000 duplicate key error index: pulp_database.erratum_pkglists.$errata_id_1_repo_id_1 dup key...

The erratum_pkglists collection will be created automatically when adding the first entry in the collection. That means the collection will be created without any unique index and the DuplicateKeyError exception in the migration script will never be raised.
The unique index will added by the pulp-manage-db after the migrations in the "Ensure indexes" state but it is too late.

Ensure/create collection and its indexes before migrating data.

Workaround: remove a document from erratum_pkglists collection which triggers the duplicate error. There could be only one duplicated document in the collection because of the way migration script is written.

Also available in: Atom PDF