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

recover locks on step up at the beginning of the state transition rather than at the end

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.1.12
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
    • Fully Compatible
    • Storage NYC 2019-05-06, Storage NYC 2019-05-20

      Prepared transactions hold collection and database IX locks across state transitions, and can only release those locks by processing a 'commitTransaction' or 'abortTransaction' command. It is very possible that in order to receive a 'commitTransaction' or 'abortTransaction' command, a node must go through a state transition to step up or down. Thus we cannot just wait for the prepared transaction to release its locks to acquire locks for the state transition.

      This means that state transitions cannot acquire locks that would conflict with locks held by a prepared transaction.

      The only state transition that I know of that acquires locks is step-up.

      Shutdown does not count as a state transition. It aborts all prepared storage transactions without making that abort durable in any way before acquiring any locks. This occurs after shutting down the replication system (though before killing all operations), so I think it should be safe.

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            judah.schvimer@mongodb.com Judah Schvimer
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: