Single document updates usually need to specify an exact match on the shard key to be allowed, so that mongos knows it can send it to a single shard and be guaranteed to only update a single document. If, however, your shard key doesn't include _id, we allow you to do a single update that matches on _id but not the shard key. This will result in sending the write to all shards, with the expectation that only one shard will contain a document with that _id. Since we don't enforce uniqueness of _id in a sharded cluster that's not sharded on _id, however, that assumption is incorrect and a single update could in fact wind up updating multiple unrelated documents.
- is duplicated by
-
SERVER-31943 Two documents can share the same documentKey when using a non-simple collation.
- Closed
- is related to
-
SERVER-14669 Updates/deletes on sharded collections shouldn't affect orphan documents
- Closed
- related to
-
SERVER-34971 Improve mongoS targeting of replacement-style updates for collections whose shard key includes _id
- Closed