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

Reacquire locks for prepared transactions on step-up can crash the server

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Repl 2022-07-11, Repl 2022-08-08, Repl 2022-08-22, Repl 2022-09-05, Repl 2022-07-25
    • 5

      On step-up, we scan all sessions and reacquire locks for prepared transactions.
      to acquire these locks we create new operation contexts using these transactions's sessions, so if these sessions got killed the opCtx got terminated which will raise an exception.

      We are calling this procedure from a no-except function that will crash the server.

      Call stack:
      1- ReplicationCoordinatorImpl::signalDrainComplete (noexcept)
          _externalState->onTransitionToPrimary(opCtx)

      2- MongoDSessionCatalog::onStepUp(opCtx)

      3- We create new opCtx to reacquire the locks to prepared txns with sessions that can be killed.

            Assignee:
            vesselina.ratcheva@mongodb.com Vesselina Ratcheva (Inactive)
            Reporter:
            m.maher@mongodb.com Moustafa Maher
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: