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

Add testing to verify proper expiration of sessions in the sessions collection

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.10, 4.0.6, 4.1.5
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • v4.0, v3.6
    • Sharding 2018-10-22, Sharding 2018-11-05

      A lack of testing exists around verifying that sessions do indeed expire from the sessions collection when their lifetime is up.

      The session expiry time is a server parameter, measured in minutes. We may want to consider increasing the granularity to seconds so we don't make tests wait an abnormal amount of time.

      Proposed Fix

      1. Change the granularity of the logical session timeout to seconds instead of minutes. Since the drivers rely on the parameter "localLogicalSessionTimeoutMinutes" to exist in calls to isMaster(), I can take the following approaches:
        1. Create a duplicate parameter "logicalSessionTimeoutSeconds" which will be in the granularity of seconds... I'm not sure how this would work, and what precedent exists for duplicating parameters.
        2. Set the timeout to X seconds internally if test commands are enabled. I don't think this would play nicely with tests, but I haven't verified.
        3. Talk to drivers for a possible downstream change to "logicalSessionTimeoutSeconds" completely.
      2. Add a test case that will run "find, wait for TTL*0.5, getMore, wait for TTL*0.5, getMore, wait for TTL*0.5, getMore, close cursor, verify the session exists" i.e. verify that the cursors remain open and the session is not expired.
      3. Once the workload is over wait for the TTL *1.5 and check that there are no sessions in the collection
      4. No need to manually invoke any refresh commands, the getMore execution guarantees that sessions are there.

            blake.oler@mongodb.com Blake Oler
            blake.oler@mongodb.com Blake Oler
            0 Vote for this issue
            5 Start watching this issue