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

Replication fails to remove document if _id value is too long to index

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.8
    • None
    • ALL

      The following sequence of operations:

      db.coll.insert( { "_id":"keyvaluethat'slongerthan1024length", "a": 5 } );
      db.coll.remove( { "a" : 5 } );
      

      results in primary of a replica set having zero documents, but secondary having one document, since remove on the secondary attempts to remove by "_id".

      Now if there is a unique index on "a" and you insert a document on the primary with "a":5 the secondary will now crash with duplicate key error while the primary successfully has only a single value.

            Assignee:
            Unassigned Unassigned
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: