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

Provide a command to list all locks

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Diagnostics, Storage
    • Labels:
      None
    • Storage NYC 2019-03-11

      Support engineers have to inspect mongod logs whenever there is a locking related issue. That approach is suboptimal as logs can be large and not straightforward to process. Also log analysis is often time consuming.

      Another approach is to get the locks information from the db.currentOp() output, however the output of that command is thread-centric, not lock centric. Often the question is simply "who's holding the global/database/collection lock". It should not be required to iterate through all of the threads in the db.currentOp() output to get the answer.

      It would be great to have a separate command that would produce a list of the MongoDB locks (e.g. Global, Metadata, Database, Collection; the latter two should indicate the names of the database objects associated with them) along with the information on the threads (e.g. thread names) that are holding them. The command should not be blocking and should not require a lock (not sure if doable).

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
            Votes:
            15 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: