[DRIVERS-2530] Do not perform server selection to determine sessions support Created: 23/Jan/23 Updated: 21/Aug/23 |
|
| Status: | Implementing |
| Project: | Drivers |
| Component/s: | Sessions |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Kaitlin Mahar | Assignee: | Daria Pardue |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Changes: | Needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quarter: | FY24Q1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Downstream Changes Summary: | Drivers should implement the sessions spec changes in 90cfaef, removing the server selection step for session support and relying exclusively on the `logicalSessionTimeoutMinutes` reported by the checked out connection instead. Two new prose tests are added to ensure the user-facing behavior for explicit and implicit sessions remains unchanged when communicating with a server that does not support sessions. This work is a pre-requisite for sever selection logging (DRIVERS-1671), which will define additional tests to ensure no server selection is performed for session support. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Program Manager: | |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Start date: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Compliance: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Currently, the sessions spec has drivers perform server selection to determine sessions support if the support status is not currently known: https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst#how-to-check-whether-a-deployment-supports-sessions This approach has some known race conditions, as documented in the spec as well (https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst#possible-race-conditions-when-checking-whether-a-deployment-supports-sessions). Drivers should update their logic to defer checking for sessions support after a connection has actually been checked out. The driver should then check that the particular server supports sessions - that is, the connection has non-null logicalSessionTimeoutMinutes. If the user supplied an explicit session and it turns out at this point sessions are not supported for the server, the driver can then raise an error. This approach simplifies session support checking and eliminates 3 of the 4 possible race conditions around sessions. This ticket is being proposed as a subset of the original work imagined in DRIVERS-2337. New Prose Tests
Note: Server selection logging work DRIVERS-1671 will define additional tests to confirm that no server selection is performed to determine session support. |
| Comments |
| Comment by Githook User [ 28/Feb/23 ] |
|
Author: {'name': 'Daria Pardue', 'email': 'daria.pardue@mongodb.com', 'username': 'dariakp'}Message: DRIVERS-2530: Defer checking for session support until after connection checkout (#1379) |