-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.2.7, 2.4.10, 2.6.3
-
Sharding EMEA
-
Fully Compatible
-
ALL
-
Sharding EMEA 2022-01-24, Sharding EMEA 2022-02-07
-
(copied to CRM)
Multi-updates and multi-deletes on sharded collections affect orphan documents, and are counted in WriteResult / getLastError stats. Writes to sharded collections should not affect orphan documents.
Affects all currently-released versions.
var st = new ShardingTest({shards:2}); assert.commandWorked(st.getDB("admin").runCommand({enableSharding: "test"})); assert.commandWorked(st.getDB("admin").runCommand({shardCollection: "test.foo", key: {_id: "hashed"}})); assert.writeOK((new Mongo("localhost:30000")).getDB("test").foo.insert({_id:0})); assert.writeOK((new Mongo("localhost:30001")).getDB("test").foo.insert({_id:0})); var res = st.getDB("test").foo.update({}, {$set: {a: 1}}, {multi: true}); assert.writeOK(res); assert.eq(1, res.nMatched); // fails with [1] != [2] res = st.getDB("test").foo.remove({}); assert.eq(1, res.nRemoved); // fails with [1] != [2]
- is related to
-
SERVER-29145 Filter out changes to documents not owned by the current shard
- Closed
- related to
-
SERVER-30970 Don't allow single-updates that aren't targetted on the shard key
- Backlog
-
SERVER-11746 Improve shard version checking for versioned (single) updates after yield
- Closed
-
SERVER-17585 Enforce shard version after yields on versioned (single) deletes
- Closed