[SERVER-80194] In sharded_agg_helpers.cpp we retrieve CollectionRoutingInfo without checking for transaction Created: 17/Aug/23 Updated: 29/Oct/23 Resolved: 22/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ivan Fefer | Assignee: | Ivan Fefer |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | QE 2023-08-21, QE 2023-09-04 | ||||||||
| Participants: | |||||||||
| Description |
|
We now use CollectionRoutingInfo, provided by CollectionRouter for out shard targeting: https://github.com/mongodb/mongo/blob/5c14aa402e3cbab58d8de1e891f00e91deb023e5/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1797 But we used to call getExecutionNsRoutingInfo function instead: The core difference is that it accounts for snapshot isolation transactions: https://github.com/mongodb/mongo/blob/5c14aa402e3cbab58d8de1e891f00e91deb023e5/src/mongo/s/cluster_commands_helpers.cpp#L791 We should add a test to check if there is a problem and fix it. |
| Comments |
| Comment by Githook User [ 22/Aug/23 ] |
|
Author: {'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}Message: |
| Comment by Ivan Fefer [ 21/Aug/23 ] |
|
Okay, several good news: 2. When it doesn't work, query fails instead of returning incorrect result. 3. The only way to make it fail is to use movePrimary, which is extremely rare in practice. Still, this is something we would like to fix, as it can cause some problems in the future. |
| Comment by Ivan Fefer [ 18/Aug/23 ] |
|
There is a jstest for this behaviour: https://github.com/mongodb/mongo/blob/master/jstests/sharding/snapshot_reads_target_at_point_in_time.js
|