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

Potential deadlock while migrating sessions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.12
    • Component/s: Sharding
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2019-04-08, Sharding 2019-05-06, Sharding 2019-05-20
    • Linked BF Score:
      12

      Description

      SessionCatalogMigrationSource::_fetchNextNewWriteOplog() uses a DBDirectClient to do a query on the oplog. This is called after obtaining a lock as part of the AutoGetActiveCloner.
      Attempting to read the oplog through the query system will end up calling waitForAllEarlierOplogWritesToBeVisible(). This will result in deadlocks sometimes, as there could be oplog writes that cannot become visible because they committed prior to some blocked uncommitted transaction that is blocked by the problematic code (thus completing the circle of deadlocks.)

      The possible change _fetchNextNewWriteOplog() to not use a DBDirectClient.

        Attachments

          Activity

            People

            Assignee:
            janna.golden Janna Golden
            Reporter:
            misha.tyulenev Misha Tyulenev
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: