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

Push commitTransaction's check for a majority-committed prepare down into the TransactionParticipant

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.13
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2019-06-03
    • 20

      SERVER-40269 introduced a check in the execution of the commitTransaction command that would cause the server to usassert if the commit was for a prepare that has not yet been majority committed. For that purpose, the command needs to acquire the replication coordinator mutex while it has its session checked out, so it needs to be interruptible. Otherwise, it can deadlock with stepdown, which holds the replication coordinator mutex while trying to check out sessions to make prepared transactions yield their locks.

      We can avoid this deadlock if we move the check into TransactionParticipant::commitPreparedTransaction, soon after the RSTL lock acquisition. Stepdown would already be holding the RSTL, and we would be interruptible while waiting to acquire it.

            Assignee:
            vesselina.ratcheva@mongodb.com Vesselina Ratcheva (Inactive)
            Reporter:
            vesselina.ratcheva@mongodb.com Vesselina Ratcheva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: