<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59: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-2283] MongoDB query using the $or operator with 54 expressions crashes mongod</title>
                <link>https://jira.mongodb.org/browse/SERVER-2283</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I have a database containing 230218 documents. Each document represents a request to a web application, parsed into the database from an Apache log. Each search comes from a particular ip address, which is represented in the document by a field named &quot;ip_as_int&quot;.  The query I am trying to run on the database asks for all searches coming from within 54 ip ranges. The form of the query is as follows, substituting for the ip_as_int values for privacy:&lt;/p&gt;

&lt;p&gt;db.search_views.find({$or: &lt;span class=&quot;error&quot;&gt;&amp;#91;{ip_as_int:{$gte:foo00, $lte:bar00}}, {ip_as_int:{$gte:foo01, $lte:bar01}}, {ip_as_int:{$gte:foo02, $lte:bar02}}, {ip_as_int:{$gte:foo03, $lte:bar03}}, {ip_as_int:{$gte:foo04, $lte:bar04}}, {ip_as_int:{$gte:foo05, $lte:bar05}}, {ip_as_int:{$gte:foo06, $lte:bar06}}, {ip_as_int:{$gte:foo07, $lte:bar07}}, {ip_as_int:{$gte:foo08, $lte:bar08}}, {ip_as_int:{$gte:foo09, $lte:bar09}}, {ip_as_int:{$gte:foo10, $lte:bar10}}, {ip_as_int:{$gte:foo11, $lte:bar11}}, {ip_as_int:{$gte:foo12, $lte:bar12}}, {ip_as_int:{$gte:foo13, $lte:bar13}}, {ip_as_int:{$gte:foo14, $lte:bar14}}, {ip_as_int:{$gte:foo15, $lte:bar15}}, {ip_as_int:{$gte:foo16, $lte:bar16}}, {ip_as_int:{$gte:foo17, $lte:bar17}}, {ip_as_int:{$gte:foo18, $lte:bar18}}, {ip_as_int:{$gte:foo19, $lte:bar19}}, {ip_as_int:{$gte:foo20, $lte:bar20}}, {ip_as_int:{$gte:foo21, $lte:bar21}}, {ip_as_int:{$gte:foo22, $lte:bar22}}, {ip_as_int:{$gte:foo23, $lte:bar23}}, {ip_as_int:{$gte:foo24, $lte:bar24}}, {ip_as_int:{$gte:foo25, $lte:bar25}}, {ip_as_int:{$gte:foo26, $lte:bar26}}, {ip_as_int:{$gte:foo27, $lte:bar27}}, {ip_as_int:{$gte:foo28, $lte:bar28}}, {ip_as_int:{$gte:foo29, $lte:bar29}}, {ip_as_int:{$gte:foo30, $lte:bar30}}, {ip_as_int:{$gte:foo31, $lte:bar31}}, {ip_as_int:{$gte:foo32, $lte:bar32}}, {ip_as_int:{$gte:foo33, $lte:bar33}}, {ip_as_int:{$gte:foo34, $lte:bar34}}, {ip_as_int:{$gte:foo35, $lte:bar35}}, {ip_as_int:{$gte:foo36, $lte:bar36}}, {ip_as_int:{$gte:foo37, $lte:bar37}}, {ip_as_int:{$gte:foo38, $lte:bar38}}, {ip_as_int:{$gte:foo39, $lte:bar39}}, {ip_as_int:{$gte:foo40, $lte:bar40}}, {ip_as_int:{$gte:foo41, $lte:bar41}}, {ip_as_int:{$gte:foo42, $lte:bar42}}, {ip_as_int:{$gte:foo43, $lte:bar43}}, {ip_as_int:{$gte:foo44, $lte:bar44}}, {ip_as_int:{$gte:foo45, $lte:bar45}}, {ip_as_int:{$gte:foo46, $lte:bar46}}, {ip_as_int:{$gte:foo47, $lte:bar47}}, {ip_as_int:{$gte:foo48, $lte:bar48}}, {ip_as_int:{$gte:foo49, $lte:bar49}}, {ip_as_int:{$gte:foo50, $lte:bar50}}, {ip_as_int:{$gte:foo51, $lte:bar51}}, {ip_as_int:{$gte:foo52, $lte:bar52}}, {ip_as_int:{$gte:foo53, $lte:bar53}}&amp;#93;&lt;/span&gt;});&lt;/p&gt;

&lt;p&gt;When I execute the query, the shell returns with &quot;Error: error doing query: failed&quot;&lt;/p&gt;

&lt;p&gt;The server crashes with: &lt;/p&gt;

&lt;p&gt;Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt;   Uncaught std::exception: std::bad_alloc, terminating&lt;br/&gt;
Thu Dec 23 16:30:57 dbexit: &lt;/p&gt;

&lt;p&gt;Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; shutdown: going to close listening sockets...&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; closing listening socket: 5&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; closing listening socket: 6&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; closing listening socket: 7&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; closing listening socket: 8&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; shutdown: going to flush oplog...&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; shutdown: going to close sockets...&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; now exiting&lt;br/&gt;
Thu Dec 23 16:30:57 dbexit: ; exiting immediately&lt;/p&gt;

&lt;p&gt;Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; shutdown: waiting for fs preallocator...&lt;br/&gt;
Thu Dec 23 16:30:57 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn1&amp;#93;&lt;/span&gt; shutdown: closing all files...&lt;br/&gt;
mongod: /opt/boost/include/boost/thread/pthread/mutex.hpp:50: void boost::mutex::lock(): Assertion `!pthread_mutex_lock(&amp;amp;m)&apos; failed.&lt;br/&gt;
Thu Dec 23 16:30:57 Got signal: 6 (Aborted).&lt;/p&gt;

&lt;p&gt;Thu Dec 23 16:30:58 Backtrace:&lt;br/&gt;
0x84a7552 0xb7f97400 0xb7f97430 0xb7d096d0 0xb7d0b098 0xb7d025ce 0x815c120 0x815ac44 0x835f182 0x835f97f 0x84a654c 0x81cd468 0x84bf1bd 0xb7e474ff 0xb7dc25ee &lt;br/&gt;
 mongod(_ZN5mongo10abruptQuitEi+0x3c2) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x84a7552&amp;#93;&lt;/span&gt;&lt;br/&gt;
 &lt;span class=&quot;error&quot;&gt;&amp;#91;0xb7f97400&amp;#93;&lt;/span&gt;&lt;br/&gt;
 &lt;span class=&quot;error&quot;&gt;&amp;#91;0xb7f97430&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /lib/tls/i686/cmov/libc.so.6(gsignal+0x50) &lt;span class=&quot;error&quot;&gt;&amp;#91;0xb7d096d0&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /lib/tls/i686/cmov/libc.so.6(abort+0x188) &lt;span class=&quot;error&quot;&gt;&amp;#91;0xb7d0b098&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /lib/tls/i686/cmov/libc.so.6(__assert_fail+0xee) &lt;span class=&quot;error&quot;&gt;&amp;#91;0xb7d025ce&amp;#93;&lt;/span&gt;&lt;br/&gt;
 mongod(_ZN5mongo6rwlockC1ERKNS_6RWLockEbb+0x160) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x815c120&amp;#93;&lt;/span&gt;&lt;br/&gt;
 mongod(_ZN5mongo9MongoFile13closeAllFilesERSt18basic_stringstreamIcSt11char_traitsIcESaIcEE+0x84) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x815ac44&amp;#93;&lt;/span&gt;&lt;br/&gt;
 mongod(_ZN5mongo8shutdownEv+0x412) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x835f182&amp;#93;&lt;/span&gt;&lt;br/&gt;
 mongod(_ZN5mongo6dbexitENS_8ExitCodeEPKc+0x18f) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x835f97f&amp;#93;&lt;/span&gt;&lt;br/&gt;
 mongod(_ZN5mongo10connThreadEPNS_13MessagingPortE+0x10cc) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x84a654c&amp;#93;&lt;/span&gt;&lt;br/&gt;
 mongod(_ZN5boost6detail11thread_dataINS_3_bi6bind_tIvPFvPN5mongo13MessagingPortEENS2_5list1INS2_5valueIS6_EEEEEEE3runEv+0x18) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x81cd468&amp;#93;&lt;/span&gt;&lt;br/&gt;
 mongod(thread_proxy+0x7d) &lt;span class=&quot;error&quot;&gt;&amp;#91;0x84bf1bd&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /lib/tls/i686/cmov/libpthread.so.0 &lt;span class=&quot;error&quot;&gt;&amp;#91;0xb7e474ff&amp;#93;&lt;/span&gt;&lt;br/&gt;
 /lib/tls/i686/cmov/libc.so.6(clone+0x5e) &lt;span class=&quot;error&quot;&gt;&amp;#91;0xb7dc25ee&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;If I repair, restart and run the query with a third of the expressions to &quot;$or&quot;, the server stays online and returns results. I also ran separate queries for each of the 54 queries with success. It turns out that running each of the 54 queries separately returns a grand total of 20 documents from the database. &lt;/p&gt;

&lt;p&gt;I&apos;d like to be able to run the single query with all 54 expressions for &quot;$or&quot;. Is there something preventing the server from returning results for a 54 argument query, or should the query be able to complete as is?&lt;/p&gt;</description>
                <environment>Crunchbang Linux 9.04</environment>
        <key id="14074">SERVER-2283</key>
            <summary>MongoDB query using the $or operator with 54 expressions crashes mongod</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="3">Duplicate</resolution>
                                        <assignee username="aaron">Aaron Staple</assignee>
                                    <reporter username="amz4f">Tony Zanella</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Dec 2010 21:54:51 +0000</created>
                <updated>Fri, 30 Mar 2012 14:24:25 +0000</updated>
                            <resolved>Tue, 28 Dec 2010 18:31:14 +0000</resolved>
                                    <version>1.6.5</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="21881" author="amz4f" created="Tue, 28 Dec 2010 18:42:52 +0000"  >&lt;p&gt;I upgraded the mongodb deb from mongodb-stable to mongodb-unstable, which is currently at 1.7.4, and the query works now.  Thanks very much for the suggestion!&lt;/p&gt;</comment>
                            <comment id="21880" author="aaron" created="Tue, 28 Dec 2010 18:31:14 +0000"  >&lt;p&gt;I think this is &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2298&quot; title=&quot;$or query with many clauses results in memory allocation failure and crash&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2298&quot;&gt;&lt;del&gt;SERVER-2298&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="21792" author="eliot" created="Thu, 23 Dec 2010 23:19:25 +0000"  >&lt;p&gt;Can you try 1.7.4?&lt;br/&gt;
I think this was a recently fixed bug.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 23 Dec 2010 23:19:25 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 8 weeks, 1 day 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>
                            13 years, 8 weeks, 1 day 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="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aaron</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>amz4f</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp9hj:</customfieldvalue>

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

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

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