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

A very-large query might fail sporadically with BSONObjectTooLarge

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • 17

      Problem 1:
      We can execute a very large query successfully, even though its explain fails with BSONObjectTooLarge

      Problem 2:
      A very large query might succeed or fail sporadically because of the following LOGV2_WARNING call in find_cmd.cpp requiring the explain output (which exceeds 16MB):

      try {
          numResults = batchedExecute(batchSize, exec.get(), firstBatch, docUnitsReturned);
      } catch (DBException& exception) {
          firstBatch.abandon();
      
          auto&& explainer = exec->getPlanExplainer();
          auto&& [stats, _] = explainer.getWinningPlanStats(ExplainOptions::Verbosity::kExecStats);
          LOGV2_WARNING(23798,
            "Plan executor error during find command",
            "error"_attr = exception.toStatus(),
            "stats"_attr = redact(stats),
            "cmd"_attr = cmdObj);
      
          exception.addContext(str::stream() << "Executor error during find command: " << nss.toStringForErrorMsg());
          throw;
      }
      

      It is unlikely that customers will be running so large queries (therefore priority = minor), but it is still an inconsistency.
      Possible solutions could be:

      • allow explain output exceed 16MB
      • fail large queries early and consistently if their explain output is above 16MB

            Assignee:
            Unassigned Unassigned
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: