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

Writing transaction oplog entries must not take locks while holding an oplog slot

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.11
    • Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2019-04-22, Repl 2019-05-06, Repl 2019-05-20
    • 30

    Description

      It is illegal to acquire new locks while holding open an oplog slot, since it can cause the deadlock described inĀ SERVER-35367. We do this in a few places when writing transaction oplog entries:

      When preparing a transaction, we reserve oplog slots here or here, then stash the locker here or here, then take a global lock here or here.

      When aborting a prepared transaction, we reserve an oplog slot here, then release locksĀ here, then take a global lock here.

      When committing a prepared transaction, we reserve an oplog slot here, then release locks here, then take a global lock here.

      (Note that the global lock acquisition for writing oplog entries for unprepared transaction commit is not a problem, since the locker is already holding the global lock.)

      Attachments

        Issue Links

          Activity

            People

              siyuan.zhou@mongodb.com Siyuan Zhou
              tess.avitabile@mongodb.com Tess Avitabile (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: