Explain on aggregation can fail

XMLWordPrintableJSON

    • Query Execution
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Apply the attached patch (to limit the amount of memory available to the Sort stage) and then run the following:

          var largeStr = '';
          for (var i = 0; i < 32 * 1024; ++i) {
              largeStr += 'x';
          }
          for (var i = 0; i < 100; ++i) {
              assert.writeOK(coll.insert({a: largeStr, b: i}));
          }
          var res = db.explainsort.explain('executionStats').aggregate([{$sort: {a:1}}])
      

      explain won't catch the "exceeded memory" error, and instead fail.

      The entire explain will also fail if we throw an exception from the inner executor here.

      To fix this, we may want to add a try-catch around the code where explain actually executes the plan, and add a new field like "executionSuccess" to the top level of explain's output.

            Assignee:
            [DO NOT USE] Backlog - Query Execution
            Reporter:
            Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: