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

The behaviour of lock acquisitions differs depending on whether OpContext or Locker is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • Concurrency
    • None
    • Storage Execution
    • ALL
    • Execution Team 2023-06-12

    Description

      There are multiple lock manager RAII classes which take both OperationContext and Locker (or both) and it looks like there exists at least one case where the behaviour of locking differs based on whether locker is passed directly or not.

      For example, if we remove the Locker-only constructor of ResourceLock, this invariant starts getting hit reliably. The condition to check for the invariant doesn't get reached if opCtx is nullptr (which is what happens if we use the locker-only constructor).

      Having such differentiation is dangerous and error-prone and we should get rid of it.

      Architecturally, the OpContext and the Locker are complementary with each other. The OpContext is necessary for the "OS-like" utilities such as interruption, deadline, the operation's settings, transactional state, etc and the Locker is just the container for the currently-acquired locks.

      Attachments

        Issue Links

          Activity

            People

              yujin.kang@mongodb.com Yujin Kang Park
              kaloian.manassiev@mongodb.com Kaloian Manassiev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: