Project

Profile

Help

Issue #3130

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 over 3 years ago. Updated almost 2 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.

Associated revisions

Revision fdfdcacf View on GitHub
Added by jwelborn over 3 years ago

updated celery conf variables for celery 4. closes #3130

Revision 10cb4e59 View on GitHub
Added by ttereshc over 3 years ago

Ensure indexes are created before erratum pkglists are getting migrated

This is needed for the case when migration is re-run after interruption.

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

History

#1 Updated by ttereshc over 3 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)

#2 Updated by dalley over 3 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

#3 Updated by ttereshc over 3 years ago

  • Sprint/Milestone set to 47

#4 Updated by ttereshc over 3 years ago

  • Status changed from ASSIGNED to POST

#5 Updated by ttereshc over 3 years ago

  • Status changed from POST to MODIFIED

#6 Updated by pcreech over 3 years ago

  • Platform Release set to 2.15.0

#7 Updated by pcreech over 3 years ago

  • Status changed from MODIFIED to 5

#8 Updated by pthomas@redhat.com about 3 years ago

Verified that upgrade with errata is successful

#9 Updated by pcreech about 3 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#10 Updated by bmbouter almost 3 years ago

  • Sprint set to Sprint 28

#11 Updated by bmbouter almost 3 years ago

  • Sprint/Milestone deleted (47)

#12 Updated by bmbouter almost 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF