Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-32064

A logical session id should be included in all command requests from the mongo shell

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Platforms 2018-01-01, Platforms 2018-01-15, Sharding 2018-06-04, Sharding 2018-06-18, Sharding 2018-07-02
    • Linked BF Score:
      0

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                18 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: