[SERVER-17039] db.currentOp() needs to display locking information Created: 25/Jan/15  Updated: 19/Sep/15  Resolved: 11/Feb/15

Status: Closed
Project: Core Server
Component/s: Concurrency, Diagnostics
Affects Version/s: 2.8.0-rc5
Fix Version/s: 3.0.0-rc9, 3.1.0

Type: Bug Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Kaloian Manassiev
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Participants:

 Description   

As part of SERVER-15614, lock stats were re-introduced to db.currentOp().

The idea is to restore this information which is important for MMAPv1 diagnostics and included timeAcquiringMicros and timeLockedMicros.

However, the whole lock mgr state is dumped into each operation, which vastly expands the size of the returned document with unhelpful information.

> db.currentOp()
{
	"inprog" : [
		{
			"desc" : "conn3",
			"threadId" : "0x299dba0",
			"connectionId" : 3,
			"opid" : 192443,
			"active" : false,
			"op" : "insert",
			"ns" : "a.a",
			"insert" : {
				"_id" : ObjectId("54c48a8fb8589b638ccabd8c"),
				"x" : 64121
			},
			"client" : "127.0.0.1:38982",
			"numYields" : 0,
			"locks" : {
				"Global" : "w",
				"MMAPV1Journal" : "w",
				"Database" : "w",
				"Collection" : "W"
			},
			"waitingForLock" : false,
			"lockStats" : {
				"Global" : {
					"acquireCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(64122),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"acquireWaitCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"timeAcquiringMicros" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"deadlockCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					}
				},
				"MMAPV1Journal" : {
					"acquireCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(128244),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"acquireWaitCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(90),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"timeAcquiringMicros" : {
						"r" : NumberLong(0),
						"w" : NumberLong(47716),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"deadlockCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					}
				},
				"Database" : {
					"acquireCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(64122),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"acquireWaitCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"timeAcquiringMicros" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"deadlockCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					}
				},
				"Collection" : {
					"acquireCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(64122)
					},
					"acquireWaitCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"timeAcquiringMicros" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"deadlockCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					}
				},
				"Metadata" : {
					"acquireCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"acquireWaitCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"timeAcquiringMicros" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"deadlockCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					}
				},
				"oplog" : {
					"acquireCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"acquireWaitCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"timeAcquiringMicros" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					},
					"deadlockCount" : {
						"r" : NumberLong(0),
						"w" : NumberLong(0),
						"R" : NumberLong(0),
						"W" : NumberLong(0)
					}
				}
			}
		}
	]
}



 Comments   
Comment by Githook User [ 11/Feb/15 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-17039 Re-add db.currentOp locking stats

This reintroduces the per-operation locking statistics.

Also reverts commit 9b1392162e0f7564cfc3b1634ab78ec1a7f7c871.

(cherry picked from commit 6e2d6ae03be6592d95334c43a726cde10247bd24)
Branch: v3.0
https://github.com/mongodb/mongo/commit/2095cb5e361e64bed19d8be122e4da7eb9ee57b7

Comment by Githook User [ 11/Feb/15 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-17039 Re-add db.currentOp locking stats

This reintroduces the per-operation locking statistics.

Also reverts commit 9b1392162e0f7564cfc3b1634ab78ec1a7f7c871.
Branch: master
https://github.com/mongodb/mongo/commit/6e2d6ae03be6592d95334c43a726cde10247bd24

Comment by Githook User [ 27/Jan/15 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-17039 Remove the currentOp lockStats section

The way this information is presented in there currently is wrong and
needs to be reevaluated. Removing now and will revise post 3.0 GA.

(cherry picked from commit 9b1392162e0f7564cfc3b1634ab78ec1a7f7c871)
Branch: v3.0
https://github.com/mongodb/mongo/commit/3bb8921bd826439265be6f648880bf83da9ef2f1

Comment by Githook User [ 27/Jan/15 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-17039 Remove the currentOp lockStats section

The way this information is presented in there currently is wrong and
needs to be reevaluated. Removing now and will revise post 3.0 GA.
Branch: master
https://github.com/mongodb/mongo/commit/9b1392162e0f7564cfc3b1634ab78ec1a7f7c871

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