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

`SessionsCollectionRS` acquires locks unnecessarily

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.0-rc0
    • Fix Version/s: 3.6.0-rc1
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Platforms 2017-10-23
    • Linked BF Score:
      0

      Description

      All usages of dispatch in the sessions collection management utility acquire database/collection locks. My suspicion is that these locks are taken for replica set primary check further down.

      Acquiring these locks has the potential of causing the code executed by DBDirectClient further down to deadlock if it happens to cause lock mode upgrade.

      All of these lock usages other than findRemovedSessions already issue write commands which will fail if the node is not primary, so this is not a problem. For findRemovedSessions, the read will fail because it doesn't have the slaveOk bit set, so this is not a problem either.

      Based on this I think it is safe to remove the lock acquisitions from dispatch altogether, which would simplify the code.

        Attachments

          Activity

            People

            Assignee:
            samantha.ritter Samantha Ritter
            Reporter:
            kaloian.manassiev Kaloian Manassiev
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: