[DOCS-11564] Docs for SERVER-33294: Report stashed in-use locks in currentOp Created: 09/Apr/18  Updated: 29/Oct/23  Resolved: 23/May/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 3.7.4

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-33294 Report stashed in-use locks in currentOp Closed
Related
is related to DOCS-11505 Document Transactions Closed
Participants:
Days since reply: 5 years, 38 weeks ago
Epic Link: DOCS: 4.0 Server

 Description   

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:

 



 Comments   
Comment by Githook User [ 23/May/18 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-11564: patch - had weird cherry-pick issue
Branch: master
https://github.com/mongodb/docs/commit/3482329d462a75a00d5c23a38964776a1dbcb4f8

Comment by Githook User [ 23/May/18 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-11564: currentOp and inactive sessions w locks
Branch: master
https://github.com/mongodb/docs/commit/dbeddae4797a1c24134c44dc4c47e6724b3fce65

Generated at Thu Feb 08 08:03:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.