[SERVER-14462] db.currentOp doesn't report locking statistics Created: 03/Jul/14  Updated: 23/Mar/15  Resolved: 25/Nov/14

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: 2.7.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Kaloian Manassiev
Resolution: Duplicate Votes: 1
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-15614 Implement locking statistics in db.cu... Closed
Related
related to SERVER-15939 stagedbg_cmd.cpp does not compile wit... Closed
is related to SERVER-13961 Move LockState under OperationContext Closed
Operating System: ALL
Participants:

 Description   

Commit 9e93c8d removed the 'desc' field from currentOp()'s output (among other fields).

Assuming that change is correct, ShardingTest.isAnyBalanceInFlight needs to be updated to stop checking the desc field:

shardingtest.js:

ShardingTest.prototype.isAnyBalanceInFlight = function() {
    if ( this.config.locks.find({ _id : { $ne : "balancer" }, state : 2 }).count() > 0 )
        return true;
 
    var allCurrent = this.s.getDB( "admin" ).currentOp().inprog;
    for ( var i = 0; i < allCurrent.length; i++ ) {
        if ( allCurrent[i].desc &&
             allCurrent[i].desc.indexOf( "cleanupOldData" ) == 0 )
            return true;
    }
    return false;
}

Old op format:

{
	"opid" : 3,
	"active" : false,
	"op" : "none",
	"ns" : "",
	"query" : {
		
	},
	"desc" : "journal",
	"threadId" : "0x103c81000",
	"waitingForLock" : false,
	"numYields" : 0,
	"lockStats" : {
		"timeLockedMicros" : {
			"R" : NumberLong(2334),
			"W" : NumberLong(564)
		},
		"timeAcquiringMicros" : {
			"R" : NumberLong(1606631),
			"W" : NumberLong(5)
		}
	}
}

New op format:

{
	"opid" : 3,
	"active" : false,
	"op" : "none",
	"ns" : "",
	"query" : {
		
	},
	"numYields" : 0,
	"lockStats" : {
		"timeLockedMicros" : {
			"R" : NumberLong(4553),
			"W" : NumberLong(1514)
		},
		"timeAcquiringMicros" : {
			"R" : NumberLong(1273105),
			"W" : NumberLong(62)
		}
	}
}



 Comments   
Comment by Githook User [ 04/Nov/14 ]

Author:

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

Message: SERVER-14462 Fix compile break on Linux 32-bit
Branch: master
https://github.com/mongodb/mongo/commit/072190514e64dca8e6fd36ecbb636d16b4b41263

Comment by Githook User [ 04/Nov/14 ]

Author:

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

Message: SERVER-14462 Make db.currentOp report currently held locks from Lock Manager
Branch: master
https://github.com/mongodb/mongo/commit/e6b62717c8f36c1a12829b21ee6d03d8193098a7

Comment by Githook User [ 04/Nov/14 ]

Author:

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

Message: Revert "SERVER-14462 Make db.currentOp report the currently held locks from the Lock Manager"

This reverts commit 1ae3facefbfdb05d3369576611eb96fb1a303815.
Branch: master
https://github.com/mongodb/mongo/commit/34bf558b24911143d3615f0af1a2f76d0ce238d0

Comment by Githook User [ 04/Nov/14 ]

Author:

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

Message: SERVER-14462 Make db.currentOp report the currently held locks from the Lock Manager
Branch: master
https://github.com/mongodb/mongo/commit/1ae3facefbfdb05d3369576611eb96fb1a303815

Comment by Githook User [ 04/Nov/14 ]

Author:

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

Message: SERVER-14462 Fix all cases where client is null when we are creating an
OperationContext
Branch: master
https://github.com/mongodb/mongo/commit/a1cc3274956e0bc1a0fc7b7fb98724eb04423a03

Comment by Githook User [ 03/Nov/14 ]

Author:

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

Message: SERVER-14462 Get rid of LockState::reportState since it is a noop today

Will be replaced by a new means of reporting the locking state.
Branch: master
https://github.com/mongodb/mongo/commit/319b9319fed8dfbafe6d3f23512f12a17fb0ed9a

Comment by Githook User [ 30/Oct/14 ]

Author:

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

Message: SERVER-14462 Clean usages of LockStat from CurOp and Client

Lock statistics will be obtained from the operation context.
Branch: master
https://github.com/mongodb/mongo/commit/f3715ef1516ce423231cfd654b2c2ac546c2e0bb

Comment by Githook User [ 29/Oct/14 ]

Author:

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

Message: SERVER-14462 Get rid of Locker::isAtLeastReadLocked
Branch: master
https://github.com/mongodb/mongo/commit/52b86fc2793042fe50dda8bf47844b71b3eb6e8d

Comment by Githook User [ 07/Aug/14 ]

Author:

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

Message: SERVER-14462 Add back desc and threadId to currentOp() output

This doesn't fully fix the bug, because the LockState information is still
missing, but adds everything except for that.
Branch: master
https://github.com/mongodb/mongo/commit/7d3048502184e1b89d502302c12da4dcbde2e221

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