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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 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

      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)

            gregory.wlodarek@mongodb.com Gregory Wlodarek
            matthew.russotto@mongodb.com Matthew Russotto
            2 Vote for this issue
            24 Start watching this issue