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

CollectionLock::relockWithMode() shouldn't relock database

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.2
    • None
    • Concurrency
    • None
    • Fully Compatible
    • Quint Iteration 3.1.2

    Description

      The CollectionLock undocumented method relockWithMode() confusingly relocks the associated database lock as a side effect. This is unintuitive and often introduces scenarios where redundant locks are held.

      For example: supposing a client holds database IX and collection IX. It is not expected that relocking the collection lock in X would also relock the database lock in X as a side effect (in which the reacquisition of the collection lock becomes redundant).

      This method was introduced to facilitate the implicit collection creation path, and so existing callers that rely on this behavior will need an audit. This implicit collection creation use case should be kept in mind when deciding how to further improve the locking API.

      Attachments

        Activity

          People

            geert.bosch@mongodb.com Geert Bosch
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: