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

Fix potential deadlock between TTLMonitor::onStepUp and prepared transaction

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0, 7.0.6, 5.0.25, 6.0.14
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v7.0, v6.0, v5.0
    • Execution NAMR Team 2023-09-18, Execution Team 2023-12-11, Execution Team 2023-12-25, Execution Team 2024-01-08, Execution Team 2024-01-22
    • 3

      The mechanism introduced in SERVER-68477 to resolve invalid expireAfterSeconds values and prevent unintended document deletions can potentially induce a deadlock during step-up with appropriate prepared transactions.

      A prepared transaction which has a write to a collection "foo" will reacquire an IX lock on "foo" prior to running the index onStepUp method, where the TTLMonitor will attempt to acquire an X lock on a collection "foo" if it decides it needs to normalize its index spec. We cannot safely reverse the order of the operations.

      As of this time we have not observed this deadlock in practice in any released builds, so we believe it to be extremely rare, and will be addressing it out of an abundance of caution.

            Assignee:
            daotang.yang@mongodb.com Daotang Yang
            Reporter:
            dan.larkin-york@mongodb.com Dan Larkin-York
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: