<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:23:43 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-10656] Cursor hangs on compound index query</title>
                <link>https://jira.mongodb.org/browse/SERVER-10656</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I am doing a range query that uses a compound index.  It covers about 1.7M results.  In java I run the query and iterate over all the results.  After the last result is read the cursor.hasNext() function hangs for over 8 minutes.&lt;/p&gt;

&lt;p&gt;If I look at the log when it finally returns it has yielded over 843,000 times.&lt;/p&gt;

&lt;p&gt;There is no other load on the server or the machine.  &lt;/p&gt;

&lt;p&gt;What&apos;s going on here?&lt;/p&gt;</description>
                <environment>osx ssd 8gb</environment>
        <key id="88077">SERVER-10656</key>
            <summary>Cursor hangs on compound index query</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="5">Cannot Reproduce</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="mattx">Matthew Cross</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Aug 2013 19:21:49 +0000</created>
                <updated>Wed, 10 Dec 2014 23:18:45 +0000</updated>
                            <resolved>Wed, 19 Mar 2014 08:45:17 +0000</resolved>
                                    <version>2.4.5</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="519039" author="stennie" created="Wed, 19 Mar 2014 08:45:17 +0000"  >&lt;p&gt;Hi Matthew,&lt;/p&gt;

&lt;p&gt;Given that we have thus far been unable to reproduce this issue, I&apos;m going to close it out.&lt;/p&gt;

&lt;p&gt;If you do see any further recurrences, please feel free to reopen with additional details.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Stephen&lt;/p&gt;</comment>
                            <comment id="420212" author="dan@10gen.com" created="Sun, 8 Sep 2013 00:11:58 +0000"  >&lt;p&gt;Yes, I was asking if this was reproducible.&lt;br/&gt;
Could you attach another log file with log level set to 5 and attach the log to this ticket?  The documentation shows how you can set the log level on a running instance: &lt;a href=&quot;http://docs.mongodb.org/manual/reference/parameters/#param.logLevel&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://docs.mongodb.org/manual/reference/parameters/#param.logLevel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Doesn&apos;t appear to have anything to do with the driver, but just in case, would you be able to run the experiment from the mongo shell?&lt;/p&gt;</comment>
                            <comment id="416751" author="mattx" created="Tue, 3 Sep 2013 14:57:36 +0000"  >&lt;p&gt;I&apos;m not sure what you mean.  I tried it this morning and I still see this hanging behavior if that is what you are asking.  I get most or all of the results and then the cursor waits on hasNext for minutes.&lt;/p&gt;

&lt;p&gt;Let me know what additional information if any, you need.&lt;/p&gt;</comment>
                            <comment id="416370" author="dan@10gen.com" created="Mon, 2 Sep 2013 21:10:56 +0000"  >&lt;p&gt;The log file seems to indicate the cursor finished iterating over the results.  Have you been able to reproduce the same behavior?&lt;/p&gt;</comment>
                            <comment id="415134" author="mattx" created="Fri, 30 Aug 2013 19:25:45 +0000"  >&lt;p&gt;The logs seem to disagree with my assertion that I have all of my results back.  I will research further.  In any case the query goes out to lunch for 8 minutes after returning 1.675M results in 116 seconds.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="30609" name="mongo.log" size="46157" author="mattx" created="Fri, 30 Aug 2013 19:21:50 +0000"/>
                    </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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 2 Sep 2013 21:10:56 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 48 weeks 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 48 weeks 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="10021"><![CDATA[OS X]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>mattx</customfieldvalue>
            <customfieldvalue>stephen.steneker@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmi3j:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>80773</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Database with 8M items.  &lt;/p&gt;

&lt;p&gt;Collection has this basic structure.&lt;br/&gt;
{ xys: [ { xy: &lt;/p&gt;
{ x: 11111, y: 11111 }
&lt;p&gt; } ] }&lt;/p&gt;

&lt;p&gt;Index looks like this&lt;br/&gt;
{&lt;br/&gt;
		&quot;v&quot; : 1,&lt;br/&gt;
		&quot;key&quot; : &lt;/p&gt;
{
			&quot;xys.xy.x&quot; : 1,
			&quot;xys.xy.y&quot; : 1
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;ns&quot; : &quot;db.foos&quot;,&lt;br/&gt;
		&quot;name&quot; : &quot;xys.xy.x_1_xys.xy.y_1&quot;&lt;br/&gt;
	}&lt;/p&gt;

&lt;p&gt;Query looks like this:&lt;/p&gt;

&lt;p&gt;BasicDBObject query = new BasicDBObject(&quot;xys&quot;,&lt;br/&gt;
			new BasicDBObject(&quot;$elemMatch&quot;,&lt;br/&gt;
				new BasicDBObject(&quot;xy.x&quot;,new BasicDBObject(&quot;$gt&quot;,boundingBox.minX).append(&quot;$lt&quot;, boundingBox.maxX))&lt;br/&gt;
				.append(&quot;xy.y&quot;,new BasicDBObject(&quot;$gt&quot;,boundingBox.minY).append(&quot;$lt&quot;, boundingBox.maxY))&lt;br/&gt;
			)&lt;br/&gt;
		);&lt;/p&gt;

&lt;p&gt;Then just iterate over the results using the latest java driver.&lt;/p&gt;

&lt;p&gt;All the expected results come back but then the cursor remains open for ages.&lt;/p&gt;

&lt;p&gt;I have also attached the log showing the excessive yields after the final results.&lt;/p&gt;</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|hspc47:</customfieldvalue>

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