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

Make mongod service entry point resilient to session yielding

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc5, 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v6.0
    • Sharding 2022-05-02, Sharding NYC 2022-05-16

      The mongod service entry point will stash a TransactionParticipant::Participant (effectively a pointer to the transaction state that decorates a Session from the SessionCatalog) and on command errors use it to clean up the transaction. If during the command the Session associated with that participant is yielded and the command is interrupted, the clean up code may run without the session checked out, so it's unsafe to access the participant.

      This is an existing issue, but before PM-2210, very few operations yielded a session (only certain aggregation stages in a transaction and the logic that waits for an ongoing prepared transaction to complete before starting a transaction with a higher txnNumber).

      Instead, the clean up code should get the participant via TransactionParticipant::get() to ensure the session is still checked out.

            Assignee:
            jack.mulrow@mongodb.com Jack Mulrow
            Reporter:
            jack.mulrow@mongodb.com Jack Mulrow
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: