[DOCS-11835] Docs for SERVER-32064: A logical session id should be included in all command requests from the mongo shell Created: 26/Jun/18  Updated: 15/Oct/18  Resolved: 26/Jun/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 4.0 Required, 4.1.1

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: ShardingTechDebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-32064 A logical session id should be includ... Closed
Participants:
Days since reply: 5 years, 33 weeks, 1 day ago

 Description   

----------------------------

Original Description

Description:

This may already be covered since it is the default driver behavior, but now the shell will use an implicit session for all requests that are not sent through an explicit session. So all requests from the shell will attach a logical session id (lsid field). There is one implicit session per mongo connection, so all requests on the same connection will use the same lsid.

Engineering Ticket Description:

Existing database methods that start an implicit session

When an existing MongoDatabase method that does not take a session is called, the driver MUST check whether the deployment supports sessions (See How to Check Whether a Deployment Supports Session). If sessions are supported, the driver MUST behave as if a new ClientSession was started just for this one operation and ended immediately after this operation completes. The actual implementation will likely involve calling client.startSession, but that is not required by this spec.

Existing collection methods that start an implicit session

When an existing MongoCollection method that does not take a session is called, the driver MUST check whether the deployment supports sessions (See How to Check Whether a Deployment Supports Session). If sessions are supported, the driver MUST behave as if a new ClientSession was started just for this one operation and ended immediately after this operation completes. The actual implementation will likely involve calling client.startSession, but that is not required by this spec.

Sending the session ID to the server on all commands

When connected to a server that supports sessions a driver MUST append the session ID to every command it sends to the server (with the exceptions noted in the following section). It does this by adding a top level lsid field to the command sent to the server. A driver MUST do this without modifying any data supplied by the application (e.g. the command document passed to runCommand).:

{ commandName: ..., lsid : { id : <UUID> } }

https://github.com/mongodb/specifications/blob/cf25e1d6afe0987d8059615c2a58a518b273be66/source/sessions/driver-sessions.rst

----------------------------

Description

Scope of changes (files that need work and how much)

Impact to other docs outside of this product

MVP (work and date?)

Resources (e.g. Scope Docs, Invision)



 Comments   
Comment by Kay Kim (Inactive) [ 26/Jun/18 ]

It's a no-op for us as it's an implicit action taken by the shell, so that the users won't need to have to act on it. Can revisit the decision if it turns out the lack of this information is causing issue.

Generated at Thu Feb 08 08:03:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.