Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11835

Docs for SERVER-32064: A logical session id should be included in all command requests from the mongo shell

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 4.0 Required, 4.1.1
    • Component/s: None
    • Last comment by Customer:
      true

      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)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              kay.kim Kay Kim (Inactive)
              Participants:
              Last commenter:
              Gregory McKeon Gregory McKeon (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 29 weeks, 6 days ago