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

collStats will fail if resulting BSON size > 16MB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Sharding, Shell
    • Labels:
      None
    • Operating System:
      ALL
    • Sprint:
      Query 2019-12-30
    • Case:

      Description

      Given a larger (50+) sharded cluster with a collection with a larger (45+) number of indexes, when running the collStats command the result will be a failure due to exceeding the internal BSON document size limit:

      mongos> db.runCommand({ collStats : "collection", scale: 1024 })
      {
         "ok" : 0,
         "errmsg" : "BSONObj size: 17465286 (0x10A7FC6) is invalid. Size must be between 0 and 16793600(16MB) First element: sharded: true",
         "code" : 10334,
         "codeName" : "Location10334"
      }
      

      See https://gist.github.com/alexbevi/dc51c0ce4820f46e46feca06dbdc64bb for reproduction details. Issue appears to originate at https://github.com/mongodb/mongo/blob/81238fa87afbe52a9658547f63c79fac126862f1/src/mongo/s/commands/cluster_coll_stats_cmd.cpp#L207 where the shard results are objectified.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              charlie.swanson Charlie Swanson
              Reporter:
              alex.bevilacqua Alex Bevilacqua
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: