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

Diagnostic log messages missing debug information for queries that encounter execution error

    • Query Execution
    • ALL

      Stats information is not gathered for queries that encounter an execution error. As a result, the per-operation diagnostic messages logged for these queries are missing debug information, and the metrics counters tracked for serverStatus are not updated for these queries.

      The following script will reproduce this issue:

      var bigDoc = {a: new Array(15*1024*1024).join("x")};
      db.setLogLevel(1);
      db.foo.drop();
      db.foo.insert([bigDoc, bigDoc, bigDoc]);
      db.foo.find().sort({a: 1}).itcount();  // 32MB sort limit exceeded, triggers execution error.
      

      When run against mongod version 3.2.1, the server generates the following diagnostic log line. Note that "nscanned" and "nscannedObjects" are not present.

      2016-01-20T18:06:36.741-0500 I QUERY    [conn3] query test.foo query: { query: {}, orderby: { a: 1.0 } } planSummary: COLLSCAN ntoreturn:0 ntoskip:0 keyUpdates:0 writeConflicts:0 exception: Executor error: OperationFailed Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit. code:17144 numYields:1 reslen:184 locks:{ Global: { acquireCount: { r: 4 } }, MMAPV1Journal: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { R: 2 } } } 21ms
      

        1. image.png
          2 kB
          Rupa Narayanan

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: