[SERVER-57561] db.view.find() breaks with --apiStrict Created: 09/Jun/21 Updated: 29/Oct/23 Resolved: 16/Jun/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 5.0.0-rc0 |
| Fix Version/s: | 5.0.0-rc2, 5.1.0-rc0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Anna Henningsen | Assignee: | Ruoxin Xu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | read-only-views | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||
| Backport Requested: |
v5.0
|
||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
As you can see, the view is trivial and its aggregation not require any unversioned APIs. |
||||||||||||||||||||||||||||||||||
| Sprint: | Query Optimization 2021-06-28 | ||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||
| Description |
|
A view cannot be accessed with .find() when the connection uses --apiStrict. Trying do to so results in BSON field 'aggregate.runtimeConstants' is not allowed with apiStrict:true. |
| Comments |
| Comment by Githook User [ 17/Jun/21 ] |
|
Author: {'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}Message: (cherry picked from commit df3417f99795335167ed7251239ab3336b2dfc0c) |
| Comment by Githook User [ 16/Jun/21 ] |
|
Author: {'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}Message: |
| Comment by A. Jesse Jiryu Davis [ 09/Jun/21 ] |
|
We should include find/aggregate/etc. on views to the list of things we test in mongos_api_params_util.js for sharding coverage. I can help with that if desired. |
| Comment by Arun Banala [ 09/Jun/21 ] |
|
It looks like find command always sets the runtimeConstants parameter in the parsed object. When we transform the query on the view to an aggregate command, we end up generating an aggregate command with default runtimeConstants values. To circumvent this problem, we should move this code after the above view transformation code. Ideally, we should replace the usage of runtimeConstants with let (which is allowed in API version 1), but that might not be such a straight forward change. |
| Comment by Tess Avitabile (Inactive) [ 09/Jun/21 ] |