Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14867

blocking issue, concerning upset(update or insert) operations

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      Centos: 6.5
      python 2.6
      mongodb 2.6.3
      pymongo 2.7.1
    • Linux

      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))

            Assignee:
            Unassigned Unassigned
            Reporter:
            mehdi.haddoun@arismore.fr Mehdi Haddoun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: