<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:57:30 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-1602] mongos crashes when multiple map reduce jobs run in parallel</title>
                <link>https://jira.mongodb.org/browse/SERVER-1602</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;mongos process crashes if we run multiple map reduce jobs in parallel. It works properly if those jobs are ran serially.&lt;/p&gt;

&lt;p&gt;The issue is not intermittent. mongos will crash every time we try to execute the jobs in parallel.&lt;/p&gt;

&lt;p&gt;Our flow is:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Generate the selector/query A&lt;/li&gt;
	&lt;li&gt;Run 3 map reduce jobs with query A&lt;/li&gt;
	&lt;li&gt;Run a query with find().skip().limit().sort() with query A and sort by B&lt;/li&gt;
	&lt;li&gt;Run a count() query with query A&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;we run these steps in parallel with 5 threads.&lt;/p&gt;

&lt;p&gt;Map reduce jobs are meant to generate a simple groupby/count resultset. &lt;/p&gt;

&lt;p&gt;map fn: function() {emit(this.FIELD, &lt;/p&gt;
{count:1}
&lt;p&gt;);}; /* FIELD is: Make, Year, VehicleType for different jobs */&lt;br/&gt;
reduce fn: function(key, vals) {var t = 0; for (var i = 0; i &amp;lt; vals.length; i++) t += vals&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt;.count; return &lt;/p&gt;
{count:t}
&lt;p&gt;;};&lt;/p&gt;
</description>
                <environment>Two identical servers with:&lt;br/&gt;
&amp;nbsp;* Ubuntu 9.10 64 bit (Linux vs8 2.6.31-22-server #60-Ubuntu SMP Thu May 27 03:42:09 UTC 2010 x86_64 GNU/Linux)&lt;br/&gt;
&amp;nbsp;* Running on Dell 1950, with 24G ram and, Dual Intel Xeon L5335&lt;br/&gt;
&lt;br/&gt;
It&amp;#39;s a simple sharded setup. mongos, and the config server is running on the first server, and the second one only runs a mongodb instance.&lt;br/&gt;
&lt;br/&gt;
</environment>
        <key id="12732">SERVER-1602</key>
            <summary>mongos crashes when multiple map reduce jobs run in parallel</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="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="occ">Onur Cakmak</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Aug 2010 22:12:08 +0000</created>
                <updated>Fri, 7 Apr 2023 16:39:22 +0000</updated>
                            <resolved>Wed, 8 Sep 2010 17:26:51 +0000</resolved>
                                    <version>1.6.0</version>
                                    <fixVersion>1.6.3</fixVersion>
                    <fixVersion>1.7.1</fixVersion>
                                    <component>Sharding</component>
                                        <votes>2</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="18338" author="auto" created="Sat, 18 Sep 2010 03:55:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;erh&apos;, &apos;name&apos;: &apos;Eliot Horowitz&apos;, &apos;email&apos;: &apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: fix Future &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1602&quot; title=&quot;mongos crashes when multiple map reduce jobs run in parallel&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1602&quot;&gt;&lt;del&gt;SERVER-1602&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/268a8a39dfa9ddb0401c3ab82c01ff01d28cee86&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/268a8a39dfa9ddb0401c3ab82c01ff01d28cee86&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="17903" author="redbeard0531" created="Wed, 8 Sep 2010 17:26:51 +0000"  >&lt;p&gt;I think I&apos;ve found the issue, please try again with tomorrows (1.7.x) nightly and reopen if this still occurs.&lt;/p&gt;

&lt;p&gt;Thanks for providing the assert and the backtrace. They made this much easier to find.&lt;/p&gt;</comment>
                            <comment id="17902" author="auto" created="Wed, 8 Sep 2010 17:24:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;RedBeard0531&apos;, &apos;name&apos;: &apos;Mathias Stearn&apos;, &apos;email&apos;: &apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: get rid of last _grab &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1602&quot; title=&quot;mongos crashes when multiple map reduce jobs run in parallel&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1602&quot;&gt;&lt;del&gt;SERVER-1602&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/323cb15d9a09ed8c238ee9e246455447cd923c24&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/323cb15d9a09ed8c238ee9e246455447cd923c24&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="17742" author="onewhomikes" created="Fri, 3 Sep 2010 03:11:37 +0000"  >&lt;p&gt;I am running into this same issue.&lt;/p&gt;

&lt;p&gt;Using latest 1.6.2 release and connecting to a mongos process via nodejs using this driver: &lt;a href=&quot;http://github.com/christkv/node-mongodb-native&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/christkv/node-mongodb-native&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My queries do not run in separate threads but instead I have 7 processes all executing map reduce queries at the same time.  Each is running a map reduce query on a separate database.&lt;/p&gt;

&lt;p&gt;Here are the map / reduce functions:&lt;br/&gt;
var map = function() { emit( &lt;/p&gt;
{ id: this.id }
&lt;p&gt;, 1 ) }&lt;br/&gt;
var reduce = function(k,vals) { var count = 0; vals.forEach( function(v) &lt;/p&gt;
{ count += v; }
&lt;p&gt; ); return count; }&lt;/p&gt;

&lt;p&gt;I ran the mongos server with -vvvv and the only suspicious output I could find was this line immediately before the crash (was last line in log):&lt;br/&gt;
Thu Sep  2 20:08:14   Assertion failure _grab client/parallel.cpp 461&lt;/p&gt;


&lt;p&gt;Also worth noting is that on the client side log I see this cryptic memory dump sometimes (but mongos does not always crash when this is output):&lt;/p&gt;

&lt;p&gt;0x4fc751 0x509a2f 0x55f3fa 0x674390 0x2aaaaaccd2f7 0x2aaaab744e3d &lt;br/&gt;
 /usr/local/mongo/bin/mongos(_ZN5mongo12sayDbContextEPKc+0xb1) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x4fc751&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /usr/local/mongo/bin/mongos(_ZN5mongo8assertedEPKcS1_j+0x10f) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x509a2f&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /usr/local/mongo/bin/mongos(_ZN5mongo6Future13commandThreadEv+0x12a) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x55f3fa&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /usr/local/mongo/bin/mongos(thread_proxy+0x80) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x674390&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /lib64/libpthread.so.0 &lt;span class=&quot;error&quot;&gt;&amp;#91;0x2aaaaaccd2f7&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /lib64/libc.so.6(clone+0x6d) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x2aaaab744e3d&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="17641" author="redbeard0531" created="Tue, 31 Aug 2010 19:59:28 +0000"  >&lt;p&gt;are you still having this issue?&lt;/p&gt;</comment>
                            <comment id="16683" author="redbeard0531" created="Tue, 10 Aug 2010 21:33:15 +0000"  >&lt;p&gt;I&apos;ve only been able to reproduce using a V8 build which has known memory leaks. Could you try using a spidermonkey build of mongod?&lt;/p&gt;</comment>
                            <comment id="16682" author="occ" created="Tue, 10 Aug 2010 20:29:56 +0000"  >&lt;p&gt;Attached an example database population script, and a multi threaded client in c#, along with a compiled binary, in case you don&apos;t have a compiler&lt;/p&gt;

&lt;p&gt;Turns out only 2 threads can crash mongos.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10345" name="1.txt" size="4109" author="occ" created="Mon, 9 Aug 2010 22:12:08 +0000"/>
                            <attachment id="10346" name="2.txt" size="6530" author="occ" created="Mon, 9 Aug 2010 22:12:08 +0000"/>
                            <attachment id="10348" name="MongoDB-SERVER-1602-Example.zip" size="743379" author="occ" created="Tue, 10 Aug 2010 20:29:56 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 10 Aug 2010 21:33:15 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 22 weeks, 4 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 22 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>auto</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>onewhomikes</customfieldvalue>
            <customfieldvalue>occ</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrphhb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21656</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_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|hrnvgn:</customfieldvalue>

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