Project

Profile

Help

Issue #3120

closed

Race condition on saving a distribution unit during "smart proxy" sync

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:
2. Medium
Version:
Platform Release:
2.14.3
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 28
Quarter:

Description

Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808) Tried to save duplicate unique keys (insertDocument :: caused by :: 11000 E11000 duplicate key error index: pulp_database.units_distribution.$distribution_id_1_family_1_variant_1_version_1_arch_1  dup key: { : "ks-Repo-Server-1.1.1-x86_64", : "Repo", : "Server", : "1.1.1", : "x86_64" })
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808) Traceback (most recent call last):
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 277, in run
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)     dist_sync.run()
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/parse/treeinfo.py", line 128, in run
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)     self._run(tmp_dir)
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/parse/treeinfo.py", line 186, in _run
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)     unit.save()
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)   File "/usr/lib/python2.7/site-packages/mongoengine/document.py", line 390, in save
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808)     raise NotUniqueError(message %% unicode(err))
Nov  6 14:36:30 test-machine pulp: pulp_rpm.plugins.importers.yum.sync:ERROR: [aa7bf120] (11567-79808) NotUniqueError: Tried to save duplicate unique keys (insertDocument :: caused by :: 11000 E11000 duplicate key error index: pulp_database.units_distribution.$distribution_id_1_family_1_variant_1_version_1_arch_1  dup key: { : "ks-Repo-Server-1.1.1-x86_64", : "Repo", : "Server", : "1.1.1", : "x86_64" })

Race condition happens here when multiple copies of the same repo are synced in parallel (for Katello case - multiple CVs of the repo are synced to "smart proxy")

Also available in: Atom PDF