Fix executionStats explain() crash for $_internalDocumentResultsAndMetadata

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      explain("executionStats") on any pipeline containing DRM tasserts 10422601 "pipeline sizes are not equal" in mergeExplains, crashing the mongod/shard handling the request.
       
      For executionStats, PlanExecutorPipeline::writeExplainOps() calls mergeExplains, which zips the two pipelines stage-by-stage and asserts equal length. DRM is a 1→N lowering: it is a single DocumentSource (one serialize() explain entry) but lowers at exec-build time to  DocumentSourceExchange + $replaceRoot (+ $setVariableFromSubPipeline when metadata is bound in-process). The stage counts differ and the assert fires.

            Assignee:
            Daniel Segel
            Reporter:
            Daniel Segel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: