ISSUE SUMMARY
If the server receives a document for insert that is missing the _id field, it should generate one. A bug in 2.6 caused mongos not to create these _id values. This can violate the assumption that all documents have an _id and can lead to errors when inserting into a collection sharded on _id.
USER IMPACT
Minor, as all drivers automatically generate the _id. Some drivers (for example the Python driver) have an option to disable generating the _id field client-side. Using this option can cause issues when inserting documents to a sharded collection on _id through a mongos.
WORKAROUNDS
Use the driver default to auto-generate _id values.
RESOLUTION
This patch will cause mongos to auto-generate _id values if they are not present.
AFFECTED VERSIONS
Version 2.6.0 is affected by this bug.
PATCHES
The patch is included in the 2.6.1 production release.
Original description
In 2.4 if document to be inserted was missing _id when it got to mongos it seems that mongos would generate the _id.
In 2.6 this does not happen. This breaks in situations where inserted document is going into collection sharded by _id or _id:"hashed".