Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-16009

[Server] Correct description of listCollections locking behavior

    XMLWordPrintableJSON

Details

    • 3

    Description

      The Locks section of the documentation for the listCollections command is outdated.

      For all versions, the description currently states:

      The listCollections command takes Intent Shared lock on the database. In previous versions, the command takes Shared lock on the database.

      Unless the nameOnly option is specified, the command also takes an Intent Shared lock on each of the collections in turn while holding the Intent Shared lock on the database.

      This seems to only have been accurate for MongoDB 4.0.

      Per this comment - in MongoDB 4.2 and 4.4 listCollections will take an Intent Shared lock on each collection while holding the Intent Shared lock on the database.

      In MongoDB 5.0 and later, listCollections does not take an intent shared lock on either the Collection or Database level (SERVER-53829)

      Attachments

        Activity

          People

            jason.price@mongodb.com Jason Price
            adam.harrison@mongodb.com Adam Harrison
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              26 weeks, 6 days ago