When a pipeline is cloned() with no argument (treated as a null ExpressionContext), some stages will create their own new expression context.
The result is a pipeline where the stages do not share the same ExpressionContext, which is wrong.
This ticket is to
(a) Fix clone() and define what it means to clone a pipeline without a new operation context. What does it mean for DocumentSources with a sub-pipeline?
(c) Add invariants to check that the members of a pipeline are using the same ExpressionContext in various places.
- related to
-
SERVER-82749 Running nested $lookup on sharded cluster can result in heap-use-after-free
- Closed