blocking issue, concerning upset(update or insert) operations

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Incomplete
    • Priority: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
              Reporter:
              Mehdi Haddoun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: