[SERVER-82042] Sharded write commands should evaluate 'let' parameter once Created: 10/Oct/23 Updated: 18/Dec/23 Resolved: 18/Dec/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.3.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Percy | Assignee: | Mihai Andrei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | QE 2023-11-27, QE 2023-12-11, QE 2023-12-25 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Write commands that take 'let' parameters should ensure those expressions are evaluated once, instead of once per shard. For example, in a multi-update you should be able to use {let: {r: {$rand: {}}}} to pick a single random value and use it consistently when updating each document.
|
| Comments |
| Comment by Githook User [ 15/Dec/23 ] |
|
Author: {'name': 'Mihai Andrei', 'email': 'mihai.andrei@mongodb.com', 'username': 'mtandrei'}Message: GitOrigin-RevId: 079ea6535731dc275ef4cda11586a8751619962c |
| Comment by Githook User [ 10/Oct/23 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: Command-level let bindings are evaluated once for the whole command. For Previously this was only working correctly for sharded aggregate queries: This commit also includes test cases to demonstrate the same bug in |