-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.4.9, 2.6.0-rc2
-
Component/s: Diagnostics, Internal Code
-
None
-
Fully Compatible
-
ALL
-
-
Sharding A (10/09/15)
-
(copied to CRM)
The two-argument constructor for Client::Context does not call enter() on the curop object, so the current op is never properly updated. This causes some weird behavior, such as the entries with empty field names in the output of the "top" command. I suspect (though have not confirmed) that this also has an impact on the profiler and the output of the inprog command (db.currentOp()).
This problem was exacerbated in 2.6 by the introduction of more callers of this 2-argument form of the Client::Context constructor.
PREVIOUS DESCRIPTION:
In 2.4, if a node is/was a secondary, there is a sub-document with empty field name in the output of top command as below. It has records for "writeLock" and "total".
> db.adminCommand({top:1}) { "totals" : { "note" : "all times in microseconds", "" : { "total" : { "time" : 27583, "count" : 1001 }, "readLock" : { "time" : 0, "count" : 0 }, "writeLock" : { "time" : 27583, "count" : 1001 }, "queries" : { "time" : 0, "count" : 0 }, "getmore" : { "time" : 0, "count" : 0 }, "insert" : { "time" : 0, "count" : 0 }, "update" : { "time" : 0, "count" : 0 }, "remove" : { "time" : 0, "count" : 0 }, "commands" : { "time" : 0, "count" : 0 } }, ...... }
In 2.6, it shows up on all the nodes in the replica set, with records for "readLock", "writeLock" (only for secondaries) and "total".
> db.adminCommand({top:1}) { "totals" : { "note" : "all times in microseconds", "" : { "total" : { "time" : 1353, "count" : 752 }, "readLock" : { "time" : 1277, "count" : 751 }, "writeLock" : { "time" : 76, "count" : 1 }, ... }