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

Docs for SERVER-33294: Report stashed in-use locks in currentOp

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.4
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Documentation Request Summary:

      This adds a new parameter to the $currentOp aggregation stage, 'idleSessions', which defaults to 'true'. If enabled, this will cause $currentOp to report any inactive sessions which are holding locks as part of a transaction, in addition to its regular output. Each session is reported as a separate document in the $currentOp output stream. The format of these entries are as follows:

      {
      	"host" : "franklinia:27017",
      	"desc" : "inactive transaction", // string is always the same
      	"lsid" : { // logical session ID
      		"id" : UUID("eb347736-8c7e-4ca7-8c7b-a43b8e61cd16"),
      		"uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
      	},
      	"txnNumber" : NumberLong(1), // transaction number
      	"waitingForLock" : false, // always false
      	"active" : false, // always false
      	"locks" : {
      		"Global" : "w",
      		"Database" : "w",
      		"Collection" : "w"
      	},
      	"lockStats" : {
      		"Global" : {
      			"acquireCount" : {
      				"r" : NumberLong(1),
      				"w" : NumberLong(1)
      			}
      		},
      		"Database" : {
      			"acquireCount" : {
      				"w" : NumberLong(1)
      			}
      		},
      		"Collection" : {
      			"acquireCount" : {
      				"w" : NumberLong(1)
      			}
      		}
      	}
      }
      

      Finally, regular currentOps will also report the transaction number (txnNumber) if the client is involved in a transaction.

       

      Scope of changes:

      • $currentOp
        • Update parameter idleSessions: true
        • Update output (added output in example)
        • Copy over output from command since $currentOp is preferred over currentOp
      • currentOp command / db.currentOp() shell helper
        • Update output transaction number (txnNumber) if the client is involved in a transaction.
      • killOp
        • update ref from db.killOp to maybe agg
          *reference/command/fsync/index (nope – since agg stage currentOp doesn't return the overall fsyncLock field)
        • update ref from db.killOp to maybe agg in example?

      Impact to other docs outside of this product:

      • check with cloud and compass team that they use db.currentOp instead of $currentOp agg stage

       

      MVP:

      Resources:

       

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 4 weeks, 4 days ago