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

[SERVER] Function for checking if server is locked, only works on replsets

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • 2

      https://www.mongodb.com/docs/upcoming/reference/command/fsync/#check-lock-status

      There is a function in the docs page that a user can run to check the lock status - it parses currentOp output

      However, when running from a mongos, the currentOp output shows output from each shard, and the fsyncLock field is inside these documents, e.g.

          {
            shard: 'shard02',
            fsyncLock: true,
            type: 'op',
            host: 'M-K4F3614CKP:30004',
            desc: 'Checkpointer',
            active: true,
            currentOpTime: '2024-05-16T17:32:45.613+10:00',
            isFromUserConnection: false,
            opid: 'shard02:4120',
            op: 'none',
            ns: '',
            redacted: false,
            command: {},
            numYields: 0,
            queues: {
              execution: { admissions: 0, totalTimeQueuedMicros: Long("0") },
              ingress: { admissions: 0, totalTimeQueuedMicros: Long("0") }
            },
            currentQueue: null,
            locks: {},
            waitingForLock: false,
            lockStats: {},
            waitingForFlowControl: false,
            flowControlStats: {}
          }
      

      But there is no top level field called fsyncLock and so this function returns "false" when run against a mongos, even when the cluster is fsyncLocked

      Please either revise the function so it works against a mongos, or add a note saying this only works when connected to a replica set (or standalone, I guess)

      I think the former (revise the function so it works against a mongos) is preferred, as soon all deployments will be sharded clusters (coming in 8.3?)

            Assignee:
            Unassigned Unassigned
            Reporter:
            joanna.cheng@mongodb.com Joanna Cheng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: