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

db.currentOp doesn't report locking statistics

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7.3
    • Component/s: Concurrency
    • ALL

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

            Assignee:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Reporter:
            kamran.khan Kamran K.
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: