[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:
Depends
depends on SERVER-42942 M/R Agg: Implement translation for cl... Closed
is depended on by SERVER-43829 Revisit mapReduce tests which were bl... Closed
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: SERVER-42916 Reject non-inline mapReduce to an existing sharded collection that is not sharded by _id
Branch: master
https://github.com/mongodb/mongo/commit/a4d3270268d55c3f4839b8944a4d3eb47543e0fd

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?

Generated at Thu Feb 08 05:01:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.