<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:58:39 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-21863] map/reduce permits documents larger than 16MB to be inserted</title>
                <link>https://jira.mongodb.org/browse/SERVER-21863</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This issue affects the following usages of the &lt;tt&gt;mapReduce&lt;/tt&gt; command:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;{&lt;tt&gt;out: {replace: &amp;lt;collectionName&amp;gt;&lt;/tt&gt;}}&lt;/li&gt;
	&lt;li&gt;{&lt;tt&gt;out: {reduce: &amp;lt;collectionName&amp;gt;&lt;/tt&gt;}} when &lt;tt&gt;&amp;lt;collectionName&amp;gt;&lt;/tt&gt; doesn&apos;t exist or is empty&lt;/li&gt;
	&lt;li&gt;{&lt;tt&gt;out: {merge: &amp;lt;collectionName&amp;gt;&lt;/tt&gt;}} when &lt;tt&gt;&amp;lt;collectionName&amp;gt;&lt;/tt&gt; doesn&apos;t exist or is empty&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The map/reduce code checks that the value &lt;tt&gt;emit()&lt;/tt&gt;-ted is less than &lt;tt&gt;BSONObjMaxUserSize / 2&lt;/tt&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.2.0/src/mongo/db/commands/mr.cpp#L1207-L1209&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.2.0/src/mongo/db/commands/mr.cpp#L223&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. The code doesn&apos;t check that the value returned by the &lt;tt&gt;reduce()&lt;/tt&gt; and &lt;tt&gt;finalize()&lt;/tt&gt; functions won&apos;t lead to inserting a document larger than &lt;tt&gt;BSONObjMaxUserSize&lt;/tt&gt; into the temporary collection, except incidentally when &lt;tt&gt;Helpers::upsert()&lt;/tt&gt; is used.&lt;/p&gt;

&lt;hr /&gt;

&lt;h6&gt;&lt;a name=&quot;Originaldescription&quot;&gt;&lt;/a&gt;Original description&lt;/h6&gt;

&lt;p&gt;The code obliquely checks BSONObjMaxUserSize in a few places, but it&apos;s unclear whether it could eventually end up calling insertDocument() after reduce, with a document that&apos;s too big.&lt;/p&gt;</description>
                <environment></environment>
        <key id="243462">SERVER-21863</key>
            <summary>map/reduce permits documents larger than 16MB to be inserted</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="max.hirschhorn@mongodb.com">Max Hirschhorn</assignee>
                                    <reporter username="milkie@mongodb.com">Eric Milkie</reporter>
                        <labels>
                            <label>code-and-test</label>
                    </labels>
                <created>Fri, 11 Dec 2015 15:38:11 +0000</created>
                <updated>Mon, 21 Nov 2016 19:56:17 +0000</updated>
                            <resolved>Fri, 15 Jan 2016 20:13:33 +0000</resolved>
                                                    <fixVersion>3.2.5</fixVersion>
                    <fixVersion>3.3.1</fixVersion>
                                    <component>MapReduce</component>
                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="1236823" author="kevin.pulo@10gen.com" created="Fri, 15 Apr 2016 07:42:06 +0000"  >&lt;p&gt;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 (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9502&quot; title=&quot;Using regex in _id breaks replication&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9502&quot;&gt;&lt;del&gt;SERVER-9502&lt;/del&gt;&lt;/a&gt;).  This causes secondaries to crash in 3.0 and earlier, and can cause silent replica set inconsistencies in 3.2.  Because the fix on this ticket causes MR to call fixDocumentForInsert, which checks for bad _id values (and other erroneous conditions) in addition to checking the BSON document size.&lt;/p&gt;</comment>
                            <comment id="1218988" author="xgen-internal-githook" created="Tue, 29 Mar 2016 22:44:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;name&apos;: u&apos;Ramon Fernandez&apos;, u&apos;email&apos;: u&apos;ramon@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21863&quot; title=&quot;map/reduce permits documents larger than 16MB to be inserted&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21863&quot;&gt;&lt;del&gt;SERVER-21863&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22767&quot; title=&quot;mongos segfault when invoking .explain() on certain operations.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22767&quot;&gt;&lt;del&gt;SERVER-22767&lt;/del&gt;&lt;/a&gt;: fix lint errors from recent backports.&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bc59fbb5a6aa562c010eff525bd3a0b905392d97&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bc59fbb5a6aa562c010eff525bd3a0b905392d97&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1218900" author="xgen-internal-githook" created="Tue, 29 Mar 2016 21:42:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;visemet&apos;, u&apos;name&apos;: u&apos;Max Hirschhorn&apos;, u&apos;email&apos;: u&apos;max.hirschhorn@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21863&quot; title=&quot;map/reduce permits documents larger than 16MB to be inserted&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21863&quot;&gt;&lt;del&gt;SERVER-21863&lt;/del&gt;&lt;/a&gt; Prevent map-reduce from inserting &amp;gt;16MB documents.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 64a7daba1746dcda0f7d25eab82d35e2c093d54f)&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/752031f3a0186167997631d64a2aea2409ab0f1a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/752031f3a0186167997631d64a2aea2409ab0f1a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1145495" author="xgen-internal-githook" created="Fri, 15 Jan 2016 20:11:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;visemet&apos;, u&apos;name&apos;: u&apos;Max Hirschhorn&apos;, u&apos;email&apos;: u&apos;max.hirschhorn@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21863&quot; title=&quot;map/reduce permits documents larger than 16MB to be inserted&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21863&quot;&gt;&lt;del&gt;SERVER-21863&lt;/del&gt;&lt;/a&gt; Prevent map-reduce from inserting &amp;gt;16MB documents.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/64a7daba1746dcda0f7d25eab82d35e2c093d54f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/64a7daba1746dcda0f7d25eab82d35e2c093d54f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1112590" author="rassi@10gen.com" created="Fri, 11 Dec 2015 21:37:54 +0000"  >&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;We should create a reproducible case of this issue.&lt;/li&gt;
	&lt;li&gt;Assuming this issue is reproducible, the map-reduce code should pass all documents to insert through fixDocumentForInsert().&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="73449">SERVER-9502</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12451" key="com.atlassian.jira.plugin.system.customfieldtypes:multiversion">
                        <customfieldname>Backport Completed</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="16541">3.2.5</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 11 Dec 2015 21:37:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 43 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 43 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>rassi</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkmfb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrdqlb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="817">QuInt E (01/11/16)</customfieldvalue>
    <customfieldvalue id="859">Query F (02/01/16)</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs4nrz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>