[SERVER-37150] Aggregation with $out can leak a cursor if the target collection is sharded Created: 14/Sep/18  Updated: 06/Dec/22  Resolved: 14/Sep/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-36911 Ensure that cluster aggregations that... Closed
Assigned Teams:
Query
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by Nicholas Zolnierz [ 14/Sep/18 ]

kyle.suarez ahh yeah good call, I guess this will provide an easy repro too.

Comment by Kyle Suarez [ 14/Sep/18 ]

nicholas.zolnierz, can we just fold this ticket into SERVER-36911?

Generated at Thu Feb 08 04:45:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.