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

Layering violation in the lock manager

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.2.0-rc0
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2022-09-19, Execution Team 2022-10-03

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: