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

db.currentOp() needs to display locking information

    • Fully Compatible
    • ALL

      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)
      					}
      				}
      			}
      		}
      	]
      }
      

            Assignee:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: