[CDRIVER-3324] Session not pinned to mongos when not relying on server selection Created: 19/Aug/19 Updated: 28/Oct/23 Resolved: 22/Aug/19 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.15.0 |
| Fix Version/s: | 1.15.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andreas Braun | Assignee: | Clyde Bazile III (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
When providing the _mongoc_client_command_with_opts function with a server_id in opts, mongoc_cluster_stream_for_server is called directly, skipping server selection logic contained in _mongoc_cluster_select_server_id. However, this also bypasses session pinning when using sharded transactions. The pinning should happen regardless of who performs server selection. Fixing this by pinning in mongoc_cluster_stream_for_server instead of during server selection also resolves a similar issue when providing a server_id option to the mongoc_bulk_operation_execute and _mongoc_cursor_fetch_stream functions. The rationale behind this is that the PHP driver performs server selection itself before issuing commands, as it needs to know which server a command ran on for result cursors and write result objects. |
| Comments |
| Comment by Githook User [ 23/Aug/19 ] |
|
Author: {'name': 'Clyde Bazile', 'email': 'bazileclyde@gmail.com', 'username': 'bazile-clyde'}Message: |
| Comment by Githook User [ 22/Aug/19 ] |
|
Author: {'username': 'bazile-clyde', 'email': 'bazileclyde@gmail.com', 'name': 'Clyde Bazile'}Message: |