[SERVER-25437] db.runCommand("top") fails when there are too many collections Created: 03/Aug/16  Updated: 04/Aug/16  Resolved: 04/Aug/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.2.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kyle Erf Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-6627 top command should return cursor Backlog
Related
Operating System: ALL
Participants:

 Description   

When there are too many namespaces in a MongoDB deployment, the top command will return a document larger than the 16MB BSON limit.

You can reproduce this easily by starting a mongod (I highly recommend using mmapv1 as it has way less overhead per collection than wt does) and doing something like

  for(var j = 0; j < 200000; j++) {
   db.createCollection("collection__"+j);
  }

Running mongotop fails with the message:

mongotop --port 7777
2016-08-03T11:16:54.361-0500	Failed: BSONObj size: 40761145 (0x26DF739) is invalid. Size must be between 0 and 16793600(16MB) First element: note: "all times in microseconds"

The shell returns that same error when running the top command manually.



 Comments   
Comment by Ramon Fernandez Marina [ 04/Aug/16 ]

Duplicate of SERVER-6627.

Comment by Michael O'Brien [ 04/Aug/16 ]

Looks like purely an issue with the size of the output of the "top" command (that error message is from the server too, not the tools code). Going to move this over to SERVER.

Comment by Kyle Erf [ 03/Aug/16 ]

This won't be fixable without changes to the server. We'll likely have to update the command to return a cursor like listCollections if we want this to be fully supported.

Generated at Thu Feb 08 04:09:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.