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

DuplicateKeyError during upsert

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 3.0.8
    • Component/s: None
    • Labels:
      None
    • ALL

      Hi,

      this error is very rare (I cannot reproduce it), it happens on production every one-two hours (operation which cause this errors have rate ~100/s).

      I read about this issue but every topic I found is about multiple unique indexes which isn't the case here.

      My collection has one unique index (_id), two regular ones and one Map Field(EmbededDocumentField).

      I think these issues started after upgrading Mongo to 3.0 and WiredTiger engine.

      Current setup:
      MongoDB 3.0.8
      PyMongo 3.2.0

      Sample query which causing issue:

      collection.update({'_id': '9737600500733084563'}, {'$inc': {'fields.123.counters.33' : 1}}, upsert=True)
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            mateuszm Mateusz Moneta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: