[SERVER-6550] db.currentOp() incorrectly reports insert secs_running as 1271310 Created: 21/Jul/12  Updated: 08/Mar/13  Resolved: 07/Mar/13

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.2.0-rc0
Fix Version/s: None

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

linux and osx


Issue Links:
Duplicate
duplicates SERVER-4740 Use monotonic clock sources for Timer Closed
Related
related to SERVER-2886 Many commands being executed for 1271... Closed
Operating System: ALL
Participants:

 Description   

First noticed this in the http console, but repro'd in the shell.

Open two different connections to mongod with and insert a million simple docs:

> for (i = 0; i < 1000000; i++) { db.foo.insert({x:i}); }

From a third shell, filter the currentOp output:

> while ( 1 ) { db.currentOp().inprog.filter(function(x) { if ( x.secs_running == 1271310 ) { printjson(x); } } ) } 

You should see lots of ops reported with the bad secs_running value:

{
	"opid" : 783608,
	"active" : true,
	"secs_running" : 1271310,
	"op" : "insert",
	"ns" : "",
	"query" : {
		
	},
	"client" : "127.0.0.1:54088",
	"desc" : "conn14",
	"threadId" : "0x112460000",
	"connectionId" : 14,
	"locks" : {
		"^" : "w",
		"^foo" : "W"
	},
	"waitingForLock" : false,
	"numYields" : 0,
	"lockStats" : {
		"timeLockedMicros" : {
			
		},
		"timeAcquiringMicros" : {
			"r" : NumberLong(0),
			"w" : NumberLong(3)
		}
	}
}

secs_running is calculated by subtracting curTimeMicros64() value from the _start recorded for the currentOp (another call to curTimeMicros64()) in curop.h – perhaps the current time value is less than the _start value causing some overflow issue?



 Comments   
Comment by Daniel Pasette (Inactive) [ 07/Mar/13 ]

duplicate of SERVER-4740

Comment by Andy Schwerin [ 01/Aug/12 ]

This number is around 14.7 days.

Comment by Andy Schwerin [ 23/Jul/12 ]

@Randolph, maybe. When you convert these numbers to microseconds, they start to look more interesting in hex. Not smoking gun interesting, but more interesting. Let's touch base in the office, tomorrow.

Comment by Randolph Tan [ 23/Jul/12 ]

dup of SERVER-2886/SERVER-4740?

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