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

Aggregation with $out can leak a cursor if the target collection is sharded

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Query
    • ALL

      In mongos, we prevent $out to a sharded collection here. However if mongos' cache is stale and it believes the collection is unsharded or doesn't exist, then we will go ahead and establish shard cursors.

      If the source collection is also sharded, then mongos will also establish a merging cursor which will run the $out on the primary shard. If this fails (in this case mongod will find the target collection to be sharded and assert here) then the original shard cursors will be leaked.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: