In order to join two DocumentSourceMatch's, we combine the _predicate's of each. This is a problem because the value of a DocumentSourceMatch's _predicate doesn't change during the call to DocumentSourceMatch::optimize(), so we may get into a scenario where we try to join an outdated set of predicates, which can lead to a tassert. Repro is in the comments.
One idea is to depend on the _matchProcessor's MatchExpression instead since that is kept up to date after optimization.
- is related to
-
SERVER-101070 Make DocumentSource::joinMatchWith operate over original BSON predicate instead of its MatchExpression
-
- Closed
-
-
SERVER-99858 Small DocumentSourceMatch and DocumentSourceLookup refactors
-
- Backlog
-
-
SERVER-101544 Investigate if DocumentSourceMatch::joinMatchWith can operate over MatchExpression instead of BSONObj
-
- Blocked
-