-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.6.3
-
Component/s: None
-
None
See related SERVER-12209.
The Python driver checks other document keys and disallows prefixed $, but apparently not for _id.
Any such _id gets inserted on the primary (despite --objcheck) but will crash all secondaries immediately after.
The Python driver should reject sending such bad {{_id}}s, and additionally converting the obvious {$oid: "..."} form to a proper ObjectId type instead.
This code run against a replica set primary crashes all secondaries:
from pymongo import MongoClient mc = MongoClient() mc.test.docs.insert({'_id': {'$oid': "52d0b971b3ba219fdeb4170e"}})
- is related to
-
SERVER-12209 _id with $prefix field causes replication failure due to unvalidated insert
- Closed
- related to
-
DRIVERS-133 Drivers should not allow sending _ids with a key starting with $
- Closed