Explain on non-existent collection returns empty results for sharded cluster aggregations

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • Hide

      I came across a bug where running an aggregation explain on a non-existent collection in mongos returns an empty result set, instead of throwing a NamespaceNotFound exception. This is due to the condition in missing cri branch of ClusterAggregate::runAggregate.

      One possible fix is to also add a check that the aggregation is not an explain ClusterAggregate::runAggregate on missing cri and to the tassert in AggregationTargeter::make..

      I have attached a reproduction script below

      Show
      I came across a bug where running an aggregation explain on a non-existent collection in mongos returns an empty result set, instead of throwing a NamespaceNotFound exception. This is due to the condition in missing cri branch of ClusterAggregate::runAggregate . One possible fix is to also add a check that the aggregation is not an explain ClusterAggregate::runAggregate on missing cri and to the tassert in AggregationTargeter::make. . I have attached a reproduction script below
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      1. repro.js
        0.5 kB
        Victor Ghita

            Assignee:
            Unassigned
            Reporter:
            Victor Ghita
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: