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

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

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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
    • None
    • None
    • None
    • None
    • None
    • None

          Assignee:
          Unassigned Unassigned
          Reporter:
          victorfilip.ghita@mongodb.com Victor Ghita
          Votes:
          0 Vote for this issue
          Watchers:
          6 Start watching this issue

            Created:
            Updated:
            None
            None
            None
            None