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

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Replication
    • ALL
    • 65

      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.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            suganthi.mani@mongodb.com Suganthi Mani
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: