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:
|