[SERVER-8259] if db.currentOp(true) exceeds 16MB, it returns invalid BSON size errors Created: 22/Jan/13  Updated: 25/Jan/19  Resolved: 25/Jan/19

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Thomas Rueckstiess Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-19318 currentOp command should return cursor Closed
depends on SERVER-8261 system for commands to return cursors Closed
Related
Operating System: ALL
Participants:

 Description   

In this case, a db.currentOp(true) was issued on a mongos shell. Presumably, this will collect all db.currentOp(true) outputs from the shards, combine them and return the end result.

I'm not sure if there is an easy way to avoid the problem. Perhaps it should only return what can fit in the 16MB document, rather than returning the error message. Or fail gracefully with a better error message.

mongos> db.currentOp(true)
Mon Jan 21 19:35:38 uncaught exception: error {
"$err" : "Invalid BSONObj size: 17828054 (0xD6081001) first element: 0: { opid: "xxx:xxxxxxx", active: false, op: "update", ns: "xxxx.xxxx", query: { _id: "xxxxxx" }, client_s: "xxxxxxxxx:xxxxx", desc: "xxxxxxxx", threadId: "xxxxxxxxxxxx", connectionId: xxxxxx, waitingForLock: false, numYields: 0, lockStats: { timeLockedMicros: { r: 0, w: 709 }, timeAcquiringMicros: { r: 0, w: 7 } } }",
"code" : 10334
}



 Comments   
Comment by Benjamin Caimano (Inactive) [ 25/Jan/19 ]

This was resolved with SERVER-19318. For reference on limitations around currentOp, see here.

Comment by Egan Neuhengen [ 10/Mar/14 ]

Incomplete results or graceful error message are both inadequate solutions. The first means the system is lying to you, the second means the command is still unscalable and prevents you from retrieving important information. Returning a document per connection instead of a giant document with everything would solve the problem and would be more appropriate to mongo's schema design philosophy and logical restraints.

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