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

Creating an index with dropDups shouldn't assert

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.2
    • Affects Version/s: 1.7.2
    • Component/s: Index Maintenance
    • None
    • ALL

      > db.g.save({a: 1})
      > db.g.save({a: 1})
      > db.g.find()
      { "_id" : ObjectId("4cd05a0ae109fa5c133e277a"), "a" : 1 }
      { "_id" : ObjectId("4cd05a0be109fa5c133e277b"), "a" : 1 }
      > db.g.ensureIndex({a: 1}, {unique: true, dropDups: true})
      E11000 duplicate key error index: test.g.$a_1  dup key: { : 1.0 }
      > db.g.find()
      { "_id" : ObjectId("4cd05a0ae109fa5c133e277a"), "a" : 1 }
      

      If the user specifies dropDups: true, there's no reason for the server to assert. This is a problem in the drivers, where we check for assertions when creating indexes.

            Assignee:
            aaron Aaron Staple
            Reporter:
            kbanker Kyle Banker
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: