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

CollectionLock::relockWithMode() shouldn't relock database

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.2
    • Affects Version/s: None
    • Component/s: Concurrency
    • None
    • Fully Compatible
    • Quint Iteration 3.1.2
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      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.

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

              Created:
              Updated:
              Resolved: