[SERVER-42916] M/R Agg: Reject non-inline mapReduce to an existing sharded collection that is not sharded by _id Created: 20/Aug/19 Updated: 29/Oct/23 Resolved: 17/Oct/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.1 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Nicholas Zolnierz | Assignee: | Nicholas Zolnierz |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Query 2019-10-21 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
In the current mapReduce implementation, there is nothing in place to explicitly reject merging to an existing sharded collection whose shard key is not {_id: 1}. However, since it uses this upsert helper which always targets by _id, the command will eventually fail. We should keep this behavior in 4.4. |
| Comments |
| Comment by Githook User [ 17/Oct/19 ] |
|
Author: {'name': 'Nicholas Zolnierz', 'username': 'nzolnierzmdb', 'email': 'nicholas.zolnierz@mongodb.com'}Message: |
| Comment by Nicholas Zolnierz [ 10/Oct/19 ] |
|
asya clarified! Should be relevant for everything other than inline. Planning to add a nice error message instead of something like "MR target collection is not allowed to be sharded". |
| Comment by Asya Kamsky [ 10/Oct/19 ] |
|
you mean reject merge into existing sharded collection, right? |
| Comment by Nicholas Zolnierz [ 04/Oct/19 ] |
|
Yeah that's right, I was imagining we would support whatever $merge currently supports. |
| Comment by Charlie Swanson [ 04/Oct/19 ] |
|
To be clear, this means we will support {_id: "hashed"}, correct? It's just that it can't be sharded by something like value or a field which doesn't exist? |