[SERVER-21863] map/reduce permits documents larger than 16MB to be inserted Created: 11/Dec/15 Updated: 21/Nov/16 Resolved: 15/Jan/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | MapReduce, Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.5, 3.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eric Milkie | Assignee: | Max Hirschhorn |
| Resolution: | Done | Votes: | 0 |
| Labels: | code-and-test | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Completed: | |||||||||
| Sprint: | QuInt E (01/11/16), Query F (02/01/16) | ||||||||
| Participants: | |||||||||
| Description |
|
This issue affects the following usages of the mapReduce command:
The map/reduce code checks that the value emit()-ted is less than BSONObjMaxUserSize / 2 here and here. The code doesn't check that the value returned by the reduce() and finalize() functions won't lead to inserting a document larger than BSONObjMaxUserSize into the temporary collection, except incidentally when Helpers::upsert() is used. Original descriptionThe code obliquely checks BSONObjMaxUserSize in a few places, but it's unclear whether it could eventually end up calling insertDocument() after reduce, with a document that's too big. |
| Comments |
| Comment by Kevin Pulo [ 15/Apr/16 ] |
|
There are other ways that MapReduce can cause bad documents to be inserted in affected versions, for example, documents with a regex for the _id field ( |
| Comment by Githook User [ 29/Mar/16 ] |
|
Author: {u'name': u'Ramon Fernandez', u'email': u'ramon@mongodb.com'}Message: |
| Comment by Githook User [ 29/Mar/16 ] |
|
Author: {u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}Message: (cherry picked from commit 64a7daba1746dcda0f7d25eab82d35e2c093d54f) |
| Comment by Githook User [ 15/Jan/16 ] |
|
Author: {u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}Message: |
| Comment by J Rassi [ 11/Dec/15 ] |
|