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

Upsert results in E11000 duplicate key error

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • WiredTiger
    • Ubuntu 14.04 3.16.0-43 64bit, 16GB RAM, i5-4690 CPU @ 3.50GHz

    Description

      I'm basically upserting documents that has random sid 1..100, and then update the hit counter on them.

      So the document looks like that:

      { 'sid': 23, 'status': 'active' 'hit': 12 }

      A timer changes the status field from 'active' to something else occasionally.

      That program runs successfully on mongodb 3.0.4 with MMAPv1 engine, but throws E11000 errors with wiredtiger.

      javascript code to replicate:
      https://github.com/yurynix/mongodb-upsert-test

      It's a reduced case of my more complicated python code (pymongo 3.0.3), which has the same problem.

      expected result:
      https://github.com/yurynix/mongodb-upsert-test/blob/master/expected.txt
      (thats the result with the default engine)

      actual result:
      https://github.com/yurynix/mongodb-upsert-test/blob/master/actual.txt

      Best regards,
      Yury.

      Attachments

        Activity

          People

            ramon.fernandez@mongodb.com Ramon Fernandez Marina
            yurynix Yury Michurin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: