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

Add global lock ordering check to avoid lock-free reads taking a normal lock

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • CAR Team 2024-10-28, CAR Team 2024-11-11, CAR Team 2024-11-25
    • 2

      In order to prevent lock ordering issues one simple approach would be to add a monotonically increasing check for the global locks. That is, the ResourceId associated to the global lock being taken must be always increasing barring recursive locks.

      Doing so would avoid having a class of issues where lock-free reads are taking a lock on a collection since normal collection locking usually locks the RSTL which comes before the global lock in the hierarchy.

      The attached patch should provide a base implementation for it and has already caught two of these issues which must be resolved before working on this ticket.

            Assignee:
            robert.sander@mongodb.com Robert Sander
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: