Project

Profile

Help

Issue #4428

closed

Upsert query raises NotUniqueError

Added by daviddavis about 5 years ago. Updated over 4 years ago.

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

Description

Feb 15 16:16:52 xxxx mongod.27017[25694]: [conn57] command pulp_database.$cmd command: update { update: "task_status", ordered: true, updates: [ { q: { task_id: "7a256849-5184-4393-98fe-05a66ba0681b" }, u: { $set: { start_time: "2019-02-15T21:16:52Z", worker_name: "reserved_resource_worker-0@xxxx", state: "running" } }, multi: false, upsert: true } ] } numYields:0 reslen:255 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } } } protocol:op_query 130ms
Feb 15 16:16:52 xxxx pulp: pulp.server.async.tasks:INFO: [7a256849] Task failed : [7a256849-5184-4393-98fe-05a66ba0681b]
Feb 15 16:16:52 xxxx pulp: celery.app.trace:ERROR: [7a256849] (26802-76000) Task pulp.server.controllers.repository.download_deferred[7a256849-5184-4393-98fe-05a66ba0681b] raised unexpected: NotUniqueError(u'Update failed (E11000 duplicate key error collection: pulp_database.task_status index: task_id_-1 dup key: { : "7a256849-5184-4393-98fe-05a66ba0681b" })',)
Feb 15 16:16:52 xxxx pulp: celery.app.trace:ERROR: [7a256849] (26802-76000) NotUniqueError: Update failed (E11000 duplicate key error collection: pulp_database.task_status index: task_id_-1 dup key: { : "7a256849-5184-4393-98fe-05a66ba0681b" })

Looks like this is a known problem starting with MongoDB 3.0 and the wiredtiger engine that is not being fixed until 4.2.

https://jira.mongodb.org/browse/SERVER-14322

The work around according to the jira is, "Currently clients can retry the update to get the same behavior which is expected from the server."

I'm concerned that other places which do upserts could hit this problem as well.


Related issues

Related to Pulp - Issue #3358: Very occasionally, a task will be processed and have a 'worker_name' of NoneCLOSED - WONTFIXActions
Related to RPM Support - Issue #4795: Pulp2 task details information returns incorrect values when polled too quicklyCLOSED - WONTFIXActions
Has duplicate Pulp - Issue #4958: queue_download_deferred raises a duplicate key errorCLOSED - DUPLICATEActions

Also available in: Atom PDF