Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2337

Assume all >=3.6 servers support sessions

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Sessions
    • Labels:
      None
    • Needed
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4491 Blocked
      CXX-2592 Blocked
      CSHARP-4351 Blocked
      GODRIVER-2576 Blocked
      JAVA-4759 Blocked
      NODE-4694 Blocked
      MOTOR-1042 Blocked
      PYTHON-3462 Blocked
      PHPLIB-1004 Blocked
      RUBY-3150 Blocked
      RUST-1499 Blocked
      SWIFT-1648 Won't Do
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-4491 Blocked CXX-2592 Blocked CSHARP-4351 Blocked GODRIVER-2576 Blocked JAVA-4759 Blocked NODE-4694 Blocked MOTOR-1042 Blocked PYTHON-3462 Blocked PHPLIB-1004 Blocked RUBY-3150 Blocked RUST-1499 Blocked SWIFT-1648 Won't Do

      Summary

      Drivers that only support MongoDB >=3.6, can remove logicalSessionTimeoutMinutes checking logic and assume all servers support sessions.

      We have confirmed with the server team in HELP-35836 that there are no edge cases requiring special handling by the drivers, since even the lower FCV mode servers will not error when seeing an lsid.

      Original Context:

      The only remaining edge case to consider is direct connections to arbiters (non-data-bearing nodes). The spec currently has client.start_session raise an error when directly connected to an arbiter. jeff.yemin@mongodb.com and I propose we remove this limitation and defer to the arbiter to report an error if lsid is not supported. 3.6 arbiters report this error:

      >>> with client.start_session() as s:
      ...     client.local.system.views.find_one(session=s)
      ... 
      Traceback (most recent call last):...
          raise OperationFailure(errmsg, code, response, max_wire_version)
      pymongo.errors.OperationFailure: cannot pass logical session id unless fully upgraded to featureCompatibilityVersion 3.6. See http://dochub.mongodb.org/core/3.6-feature-compatibility ., full error: {'ok': 0.0, 'errmsg': 'cannot pass logical session id unless fully upgraded to featureCompatibilityVersion 3.6. See http://dochub.mongodb.org/core/3.6-feature-compatibility .', 'code': 72, 'codeName': 'InvalidOptions'}
      

      4.0+ arbiters appear to allow 'lsid':

      >>> with client.start_session() as s:
      ...     client.local.system.replset.find_one(session=s)
      ... 
      {'_id': 'repl0', ...}
      

      Note that 3.6 arbiters are always in the lower FCV mode:

      The default in-memory value for FCV on mongod is 3.4, and it only gets set to 3.6 in the OpObserver when it sees an FCV document with the value 3.6, so since an arbiter is not data bearing, it will never see the document. We do not have a mechanism for arbiters to know the FCV of the replica set.

      Motivation

      This change will simplify implicit and explicit session creation and SDAM Topology updates by removing this section and the associated race conditions: https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst#how-to-check-whether-a-deployment-supports-sessions

      Is this issue urgent?

      No

      Is this ticket required by a downstream team?

      No

      Is this ticket only for tests?

      No

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: