[SERVER-25535] Remove injectExpressionContext() methods from pipeline directory Created: 10/Aug/16  Updated: 05/Apr/17  Resolved: 16/Dec/16

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

Type: Task Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-27395 $bucketAuto aggregation with $addToSe... Closed
is duplicated by SERVER-27537 Seg fault with $max and $bucketAuto Closed
is duplicated by SERVER-27575 Segmentation fault when trying to use... Closed
is duplicated by SERVER-27579 $bucketAuto with ouput accumulator $m... Closed
is duplicated by SERVER-27626 Segfault when using $bucketAuto with ... Closed
is duplicated by SERVER-27518 max accumulator with auto-buckets can... Closed
Related
related to SERVER-27201 $graphLookup triggers null pointer de... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Query 2016-11-21, Query 2016-12-12, Query 2017-01-23
Participants:

 Description   

Before SERVER-25038 we were parsing the aggregation pipeline before we acquired the collection lock, and thus before we knew whether there was a default collation to use, so we added injectExpressionContext() as a callback to inform the pipeline of the new collation (if necessary). Once SERVER-25038 is resolved, we can remove injectExpressionContext(), and make everything that might make string comparisons take an ExpressionContext as an argument to the constructor/parser, thus ensuring all comparisons can use the correct collation.



 Comments   
Comment by David Storch [ 27/Dec/16 ]

Hi aqueen, yes, this has been merged into the v3.4 branch and will be released with the forthcoming 3.4.2 version. Our release process will automatically update the fixVersion to 3.4.2 when the build becomes available, but I'll update it manually in order to make the state more clear.

Comment by Aaron Queen [ 24/Dec/16 ]

From the previous comment, it appears this might be merged in with the 3.4 branch. Could you update this issue with the expected 3.4.x fix version?

Comment by Githook User [ 22/Dec/16 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-25535 Remove injectExpressionContext().

These methods were formally used to propagate a new ExpressionContext to
stages, accumulators, or expressions which potentially needed to
comparisons. Originally, this was necessary since Pipeline parsing
happened outside of the collection lock and thus could not determine if
there was a default collation on the collection. This meant that the
collation could change after parsing and any operators that might
compare strings would need to know about it.

We have since moved parsing within the lock, so the collation can be
known at parse time and the ExpressionContext should not change. This
patch requires an ExpressionContext at construction time, and disallows
changing the collation on an ExpressionContext.

(cherry picked from commit 37e720678f6e468726c6cc775a5dc898d080f0f3)
Branch: v3.4
https://github.com/mongodb/mongo/commit/669d6ffed2e3da347d8f55f3e54da3e7374218ff

Comment by Githook User [ 16/Dec/16 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-25535 Remove injectExpressionContext().

These methods were formally used to propagate a new ExpressionContext to
stages, accumulators, or expressions which potentially needed to
comparisons. Originally, this was necessary since Pipeline parsing
happened outside of the collection lock and thus could not determine if
there was a default collation on the collection. This meant that the
collation could change after parsing and any operators that might
compare strings would need to know about it.

We have since moved parsing within the lock, so the collation can be
known at parse time and the ExpressionContext should not change. This
patch requires an ExpressionContext at construction time, and disallows
changing the collation on an ExpressionContext.
Branch: master
https://github.com/mongodb/mongo/commit/37e720678f6e468726c6cc775a5dc898d080f0f3

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