Do not acquire storage tickets just to set/wait on oplog visibility

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.2.16, 4.0.27, 4.4.10, 5.0.4, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.0, v4.4, v4.2, v4.0
    • Execution Team 2021-08-09, Execution Team 2021-08-23
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When we wait on oplog visibility with waitForAllEarlierOplogWritesToBeVisible, and when we set oplog visibility with oplogDiskLocRegister, we acquire a global lock, which automatically takes a storage read ticket. Together, doing both can result in a deadlock. Just having waitForAllEarlierOplogWritesToBeVisible take a ticket can result on local reads blocking behind reads with a read concern that's waiting for oplog writes. Since neither operation affects the resources protected by read tickets, we should use skipAcquireTicket() when acquiring these locks.

      (We may need an RAII type to set/restore that flag)

            Assignee:
            Gregory Wlodarek
            Reporter:
            Matthew Russotto
            Votes:
            2 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: