[CDRIVER-3070] Do not include lsid in commands if topology does not support sessions Created: 03/Apr/19 Updated: 27/Oct/23 Resolved: 07/Jul/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.9.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | Roberto Sanchez |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
I came across this while researching test failures for Sending the session ID to the server on all commands only specifies that drivers MUST set the lsid field if a deployment supports sessions, but does not explicitly prohibit including lsid otherwise. Interestingly, standalone servers don't seem to complain about the field and likely ignore it. While including the lsid is probably harmless, I'm not sure if we're missing a chance to raise a client-side error in the event the user is trying to specify an explicit session on an outgoing command and the topology does not support it. |
| Comments |
| Comment by Roberto Sanchez [ 07/Jul/20 ] |
|
jmikola thanks for following up. I checked with Kevin and with his concurrence I am closing this issue. |
| Comment by Jeremy Mikola [ 07/Jul/20 ] |
|
Based on resolved spec change for DRIVERS-1230, I think libmongoc is behaving correctly and this may not require any changes. If the standalone is reporting logicalSessionTimeoutMinutes, it does support sessions (obviously that doesn't extend to transactions, retryable writes). |
| Comment by Kevin Albertson [ 10/Aug/19 ] |
|
Now that the sessions spec has spec tests, we should add a spec test to check this behavior. Created SPEC-1410. Also, note that fixing this bug will reveal another bug in how options are applied to commands we send: |
| Comment by Jeremy Mikola [ 03/Apr/19 ] |
|
Looking into this a bit more, I believe libmongoc thinks the standalone supports sessions because its isMaster response includes logicalSessionTimeoutMinutes. |