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

db.runCommand("top") fails when there are too many collections

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

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kyle.erf Kyle Erf
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: