[SERVER-6769] ExpressionNary (and others) do not properly serialize constant expressions, can cause a valid expression on mongos to be unparsable or incorrect on shards. Created: 15/Aug/12 Updated: 11/Jul/16 Resolved: 11/Sep/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Matt Dannenberg |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
An object or string specified as a constant to an ExpressionNary may not be parsed as a constant on a shard. This is because ExpressionNary does not use requireExpression with addToBsonArray, so constants are not represented using $const. Test
When fixing this we should also do a general audit for other cases that do not serialize properly. |
| Comments |
| Comment by Matt Dannenberg [ 11/Sep/13 ] | |||||||||||||||||
|
done as part of this commit: added a test based on the description here to jstests/aggregation/testshard1.js | |||||||||||||||||
| Comment by Mathias Stearn [ 17/Aug/12 ] | |||||||||||||||||
|
Good point. | |||||||||||||||||
| Comment by Aaron Staple [ 17/Aug/12 ] | |||||||||||||||||
|
An explicit $const made the test a bit easier to write, but it's not the only way something like this can happen. See following test, I think there are other ways it can happen as well
| |||||||||||||||||
| Comment by Mathias Stearn [ 17/Aug/12 ] | |||||||||||||||||
|
FYI - At least for now, $const is supposed to be an implementation detail of the serialization between mongos and mongod and NOT a user visible feature. In particular it is not documented for cases such as this. | |||||||||||||||||
| Comment by Aaron Staple [ 15/Aug/12 ] | |||||||||||||||||
|
Tentatively scheduling for 2.3.0. |