[SERVER-14867] blocking issue, concerning upset(update or insert) operations Created: 12/Aug/14  Updated: 10/Dec/14  Resolved: 12/Aug/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mehdi Haddoun Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos: 6.5
python 2.6
mongodb 2.6.3
pymongo 2.7.1


Issue Links:
Duplicate
Operating System: Linux
Participants:

 Description   

Hi,

Recently, i have encountered a blocking issue.
I'm trying to upsert a document "10 times" in a sharded collection, this latter is indexed on two keys (date and key).
In addition if i execute the same operation in mongo shell it succeed
I use pymongo driver.
the following code explains my operations:

for i in xrange(10): # @UnusedVariable
collection.update(

{"date": data["date"], "key": data["key"]}

,

{ "$set" : data }

, upsert=True)
if self.kpi_data_exist(None, data["key"], data["date"]):
break
gevent.sleep(0.2)
else:
raise Exception("Insertion fail of:"+str(data))


Generated at Thu Feb 08 03:36:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.