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

3 way deadlock between applyOps cmd, prepared transaction and secondary oplog fetcher initiated find command

    XMLWordPrintable

Details

    • Bug
    • Status: Blocked
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • Replication
    • None
    • ALL
    • 65

    Description

      3 way deadlock involving applyOps cmd, prepared transaction and oplog find command  can occur on a primary.
      1) applyOps cmd enqueues global lock in X mode and stuck behind prepared transaction due to global lock conflict.
      2) Prepared transaction holding global lock in IX mode, waits for the prepareTransaction oplog entry to be majority replicated. But stuck behind the Secondaries oplog replication.
      3) Secondary oplog fetcher initiated find cmd on oplog collection is waiting for global lock to acquire in IS mode but stuck behind the applyOps cmd due to enqueued global lock .

      To be noted, 'applyOps' cmd by default runs in atomic mode. Atomic mode apply ops consisting of CRUD ops always take global lock in X mode.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-repl Backlog - Replication Team
              suganthi.mani@mongodb.com Suganthi Mani
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: