[SERVER-45529] Implement and test invalid usage of $unionWith aggregation stage Created: 13/Jan/20  Updated: 29/Oct/23  Resolved: 06/Feb/20

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

Type: Task Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-45399 Add basic union aggregation stage for... Closed
is depended on by SERVER-45712 Remove flag guard for $unionWith Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2020-02-10
Participants:

 Description   
  • $unionWith is not allowed to read from a sharded collection if it is part of the inner pipeline of a $lookup.
  • Disallowed within an update pipeline
  • Disallowed alongside a $changeStream

The sub-pipeline has the following restrictions:

  • Cannot contain stages which write data ($merge, $out).
  • Cannot contain a $changeStream stage, or any collection-less aggregation stage.
  • Cannot contain a stage which must run on mongos or the local host that the command was sent. At the moment, the only relevant stages are $listCachedAndActiveUsers, $listLocalSessions, $currentOp with localOps: true, and several internal change stream stages.


 Comments   
Comment by Githook User [ 06/Feb/20 ]

Author:

{'name': 'Nicholas Zolnierz', 'username': 'nzolnierzmdb', 'email': 'nicholas.zolnierz@mongodb.com'}

Message: SERVER-45529 Add new stage constraint for $unionWith sub-pipeline
Branch: master
https://github.com/mongodb/mongo/commit/17d9a4f0a2b5ccec16edd50d0137bd0e83134661

Comment by Githook User [ 06/Feb/20 ]

Author:

{'name': 'Nicholas Zolnierz', 'username': 'nzolnierzmdb', 'email': 'nicholas.zolnierz@mongodb.com'}

Message: SERVER-45529 Add new stage constraint for $unionWith sub-pipeline
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/171f3ce906cdc7d8093996fe19462e54451db5b7

Comment by Nicholas Zolnierz [ 14/Jan/20 ]

To add to the list above, we should add a test for $lookup on a view spec with $unionWith and verify that it fails if the union'ed collection is sharded.

Generated at Thu Feb 08 05:09:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.