Issue #3130
closedUpgrade 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"
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.
Added by jwelborn over 7 years ago
Updated by ttereshc about 7 years ago
- Subject changed from Upgrade from Pulp 2.13.2- to Pulp 2.13.3+ results in "duplicate key error index: pulp_database.erratum_pkglists.$errata_id_1_repo_id_1 dup key" to 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"
- Description updated (diff)
Updated by dalley about 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ttereshc
- Priority changed from Normal to High
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
Updated by ttereshc about 7 years ago
- Status changed from ASSIGNED to POST
Added by ttereshc about 7 years ago
Revision 10cb4e59 | View on GitHub
Ensure indexes are created before erratum pkglists are getting migrated
This is needed for the case when migration is re-run after interruption.
Updated by ttereshc about 7 years ago
- Status changed from POST to MODIFIED
Applied in changeset 10cb4e59b0ff80904e4704a73ff5e3fdb4762860.
Updated by pcreech almost 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
updated celery conf variables for celery 4. closes #3130