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

Layering violation in the lock manager

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Execution Team 2022-09-19, Execution Team 2022-10-03

      The RAII classes in d_concurrency.h/.cpp are strictly part of the lock manager. As such, they should be completely decoupled from the database/collection catalog and should not know about UUIDs or anything else that is strictly catalog.

      This is not the case currently since the CollectionLock object at the very least is aware of the collection catalog which is a layering violation that can lead to bugs such as SERVER-67382.

      UPDATE:

      Proposed solution is to add a lightweight RAII type on top of the CollectionLock use. The selection to use the CollectionLock in the first place, over AutoGetCollection*, may imply that sharding/view/storage checks are not desired for the use cases. So we'd have to investigate what works.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: