[SERVER-37779] mongos does not correctly enforce that a change stream must be the first stage Created: 26/Oct/18 Updated: 29/Oct/23 Resolved: 07/Nov/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 4.0.0, 4.1.4 |
| Fix Version/s: | 4.0.5, 4.1.5 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Charlie Swanson | Assignee: | Charlie Swanson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.0
|
||||||||
| Participants: | |||||||||
| Linked BF Score: | 45 | ||||||||
| Description |
|
The $changeStream stage is implemented by parsing as a single stage, but expanding into several internal-only stages for execution. One of those stages (DocumentSourceOplogMatch) is responsible for enforcing that it must be the first stage in the pipeline. Unfortunately, there are some cases where we never send a $changeStream to a shard, and so we never create a DocumentSourceOplogMatch, and so it is never enforced that it must be the first stage in the pipeline. For example, the following pipeline should be illegal, but the $changeStream stage stays on mongos, because the $sort stage forces a split in the pipeline and keeps the merging half on mongos:
|
| Comments |
| Comment by Githook User [ 14/Nov/18 ] |
|
Author: {'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}Message: Adds an additional check which enforces a $changeStream stage must be (cherry picked from commit 505114314a5f4309f2857573db442604cb0e2b26) |
| Comment by Githook User [ 07/Nov/18 ] |
|
Author: {'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}Message: Adds an additional check which enforces a $changeStream stage must be |
| Comment by Charlie Swanson [ 02/Nov/18 ] |
|
This is through code review, just waiting for 4.0 to unfreeze |