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

planCacheListQueryShapes should return cursor

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.7
    • Component/s: Querying
    • Labels:
      None
    • Query
    • Fully Compatible
    • ALL

      In a busy collection the following error was encountered.

      mgoll@hostxyz ~ $ mongo mydatabase
      MongoDB shell version: 3.0.7
      connecting to: mydatabase
      big:PRIMARY> db.mycollection.getPlanCache().listQueryShapes()
      2015-11-14T07:24:31.438-0800 E QUERY    Error: error: {
      	"$err" : "BSONObj size: 66141993 (0x3F13F29) is invalid. Size must be between 0 and 16793600(16MB)",
      	"code" : 10334
      }
          at Error (<anonymous>)
          at DBQuery.next (src/mongo/shell/query.js:259:15)
          at DBCollection.findOne (src/mongo/shell/collection.js:189:22)
          at DB.runCommand (src/mongo/shell/db.js:58:41)
          at DBCollection._dbCommand (src/mongo/shell/collection.js:105:21)
          at PlanCache._runCommandThrowOnError (src/mongo/shell/collection.js:1716:32)
          at PlanCache.listQueryShapes (src/mongo/shell/collection.js:1727:17)
          at (shell):1:27 at src/mongo/shell/query.js:259
      

      Many of the queries made against this collection have unusually large clauses (over 4kB) so I hypothesize that size multiplied by the default internal query cache size has allowed 16MB to be exceeded.

      Maybe a normalized query shape should be saved instead of originals which may have large query args, particularly due to arrays. The normalized form will keep the query shapes small and make it much harder to exceed 16MB.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            akira.kurogane Akira Kurogane
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: