[SERVER-30970] Don't allow single-updates that aren't targetted on the shard key Created: 06/Sep/17  Updated: 12/Dec/23

Status: Backlog
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: LamontN
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-31943 Two documents can share the same docu... Closed
Related
related to SERVER-34971 Improve mongoS targeting of replaceme... Closed
is related to SERVER-14669 Updates/deletes on sharded collection... Closed
Assigned Teams:
Cluster Scalability
Participants:

 Description   

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.



 Comments   
Comment by Spencer Brody (Inactive) [ 06/Sep/17 ]

This can also cause updates to orphaned documents left behind by failed chunk migrations, which can result in spurious change stream notifications.

Generated at Thu Feb 08 04:25:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.