[SERVER-3530] Certain types of invalid keys which buggy drivers permit (such as invalid $ operators) can save in server validly, but choke replication Created: 03/Aug/11  Updated: 10/Dec/14  Resolved: 23/May/13

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 1.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Brendan W. McAdams Assignee: Matt Dannenberg
Resolution: Cannot Reproduce Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

Certain keys which are technically invalid in MongoDB can still be inserted into the database and save validly.

However, they will choke the replication system and cause all secondaries' attempts to replicate that data to fail.

By way of example, Java Drivers prior to version 2.4 allowed insert with an arbitrary made-up "$" operator field name, which will insert correctly but fail on replication as evinced in CS-1059.

Using a release of Casbah linked against Java Driver 2.3, I can insert the following:

scala> m.insert(MongoDBObject("_id" -> MongoDBObject("$uid" -> "OMGWTFBBQ")))
res1: com.mongodb.WriteResult =

{ "n" : 0 , "connectionId" : 253 , "err" : null , "ok" : 1.0}

Which shows up in MongoDB as:

> db.omgPonies.find()
{ "_id" :

{ "$uid" : "OMGWTFBBQ" }

}

Replica members will, however, report an error when trying to replicate the oplog entry for the insert along the lines of "[rs_sync] replSet syncThread: 10068 invalid operator: $uid "



 Comments   
Comment by Matt Dannenberg [ 23/May/13 ]

This bug is for a very old version at this point and I was unable to reproduce it on the current version with the C++ driver.

Comment by Allen Jensen [ 02/Aug/12 ]

SERVER-328 looks like was related to this

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