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

Explain on aggregation can fail

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Querying
    • Query Execution
    • ALL

    Description

      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.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: