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

collStats will fail if resulting BSON size > 16MB

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding, Shell
    • None
    • ALL
    • Query 2019-12-30

      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.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            alex.bevilacqua@mongodb.com Alex Bevilacqua
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: