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

Disable logical sessions if FCV is 3.4

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.9
    • Affects Version/s: 3.6.8
    • Component/s: Sharding
    • Fully Compatible
    • ALL
    • Sharding 2018-10-22, Sharding 2018-11-05

      The following scenario causes the server to stop accepting sessions.

      • the driver creates logical sessions implicitly assuming the server supports it. Per offline chat with behackett the driver implicitly starts a session on the server iff the isMaster has a logicalSessionTimeoutMinutes set (https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst) and mongos 3.6 unconditionally returns that value in isMaster because it has no concept of FCV
      • the mongos passes the command to mongod
      • mongod creates the session in the cache but fails to add it to a collection because it does not have the config.systme.sessions collection with FCV 3.4
      • without config.sessions.collection sessions are not expired and eventually hit the max of the activeSessionsCount = 1,000,000

      Suggested Fix

      The gist of the fix is mongos should rely on sessions collection existence on the config server to return the logicalSessionTimeoutMinutes in isMaster and handling explicit sessions operations.

      • every refreshSessions SessionsCollection needs to detect if the sessions collection exists and set the corresponding member
      • add a method to LogicalSessionsCache::hasSessionsTable that retruns SessionsCollection::hasSessionsTable
      • run LogicalSessionsCache::refreshNow on startup
      • add logicalSessionTimeoutMinutes to isMaster if (FCV ==3.6) && LogicalSessionsCache::hasSessionsTable()
      • reject explicit sessions operations if !LogicalSessionsCache::hasSessionsTable()

      FCV update 3.6 to 3.4

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: