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

fsyncLock documentation does not discuss behaviour of multiple locks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual
    • Labels:
      None
    • Last comment by Customer:
      true
    • Sprint:
      KANBAN BUCKET

      Description

      If you issue multiple calls to db.fsyncLock, each invocation takes a separate lock, and you need to ensure you pair an exact number (or greater number) of matching db.fsyncUnlock commands to unlock things.

      This is not necessarily intuitive behaviour - many people might assume there are only two states - locked and unlocked, and that multiple calls to db.fsyncLock whilst locked are simply idempotent (and similarly for db.fsyncUnclock).

      The output of the commands also doesn't give any clues about this behaviour either:

      > db.fsyncLock()
      {
              "info" : "now locked against writes, use db.fsyncUnlock() to unlock",
              "seeAlso" : "http://dochub.mongodb.org/core/fsynccommand",
              "ok" : 1
      }
      

      > db.fsyncUnlock()
      { "ok" : 1, "info" : "unlock completed" }
      

      Nor is it mentioned on either the documentation for fsync or db.fsyncLock:

      Is it possible to document this behaviour in either/both of those locations?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kay.kim Kay Kim (Inactive)
              Reporter:
              victor.hooi Victor Hooi
              Participants:
              Last commenter:
              Kay Kim Kay Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 35 weeks, 2 days ago
                Date of 1st Reply: