[SERVER-12406] Replication fails to remove document if _id value is too long to index Created: 18/Jan/14  Updated: 10/Dec/14  Resolved: 21/Jan/14

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Replication
Affects Version/s: 2.4.8
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Asya Kamsky Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-5290 fail to insert docs with fields too l... Closed
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 21/Jan/14 ]

There is no sane fix for this.
SERVER-5290 fixes the root cause, so won't be an issue in the future.

Comment by Asya Kamsky [ 18/Jan/14 ]

I believe 2.5 will have the same behavior if the unindexable _id document already exists.

Generated at Thu Feb 08 03:28:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.