[SERVER-34347] Batch write with ranged query predicate mixed with single target triggers invariant on mongos Created: 05/Apr/18 Updated: 29/Oct/23 Resolved: 27/Apr/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.6.2, 3.7.3 |
| Fix Version/s: | 3.6.5, 4.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Randolph Tan | Assignee: | Janna Golden |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Backport Requested: |
v3.6
|
||||||||||||||||
| Sprint: | Sharding 2018-04-23, Sharding 2018-05-07 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
This is because whenever a targeted write need to be sent to multiple shards, the endpoint shard version will be overriden to have ignored version. If the batch has a mixed of writes that are multi target and single targets, it will end up with endpoints that have the original versions and the one with ignored versions even though they are the same shards. Since the batchMap is keyed by the ShardEndPoint (which is the (shard, version) pair), it will miss this check and end up with a map with multiple entries for the same shard. This will in turn, trigger the invariant here.
|
| Comments |
| Comment by Githook User [ 01/May/18 ] |
|
Author: {'email': 'golden.janna@gmail.com', 'name': 'jannaerin', 'username': 'jannaerin'}Message: |
| Comment by Githook User [ 30/Apr/18 ] |
|
Author: {'email': 'golden.janna@gmail.com', 'username': 'jannaerin', 'name': 'jannaerin'}Message: |
| Comment by Githook User [ 27/Apr/18 ] |
|
Author: {'email': 'golden.janna@gmail.com', 'username': 'jannaerin', 'name': 'jannaerin'}Message: |
| Comment by Randolph Tan [ 05/Apr/18 ] |
|
This appear to only affect v3.6 and newer since the invariant did not exist in older versions. |
| Comment by Randolph Tan [ 05/Apr/18 ] |
|
Attached test.js that demonstrates this issue |