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

isMaster, rs.status hold write lock?

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual, Server
    • Labels:

      Description

      https://docs.mongodb.org/manual/faq/concurrency/

      The following administrative commands lock the database but only hold the lock for a very short time:
       
      db.collection.dropIndex(),
      db.getLastError(),
      db.isMaster(),
      rs.status() (i.e. replSetGetStatus),
      db.serverStatus(),
      db.auth(), and
      db.addUser().
      
      

      I deep into the source codeļ¼Œand did some test work, found that the following operaiotn will not lock the database, if this document is not update to date?

      db.getLastError(),
      db.isMaster(),
      rs.status() (i.e. replSetGetStatus),
      db.serverStatus(),
      

        Attachments

          Activity

            People

            Assignee:
            kay.kim Kay Kim (Inactive)
            Reporter:
            zyd_com@126.com Zhang Youdong
            Participants:
            Last commenter:
            Luke Bonanomi Luke Bonanomi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              1 year, 41 weeks, 6 days ago
              Date of 1st Reply: