<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:38:51 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-35106] cursor iteration freeze after the 101 docs  (1st batch + 1)</title>
                <link>https://jira.mongodb.org/browse/SERVER-35106</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I got an cursor from the simplest query possible&lt;/p&gt;

&lt;p&gt;(b.some_collection.find()),&lt;/p&gt;

&lt;p&gt;and if the collection is big, the iteration on the cursor will pause after the first 101 docs are iterated (the 1st batch plus 1 more doc). The mongod process is doing a lot I/O reading. It looks like it&apos;s loading the whole data in.&#160;&lt;/p&gt;

&lt;p&gt;That will make my code freeze for a long time for large collections. The same thing happens no matter I do the query via pymongo or in the mongo shell.&lt;/p&gt;</description>
                <environment></environment>
        <key id="546965">SERVER-35106</key>
            <summary>cursor iteration freeze after the 101 docs  (1st batch + 1)</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="5">Cannot Reproduce</resolution>
                                        <assignee username="nick.brewer">Nick Brewer</assignee>
                                    <reporter username="rambo_yuanbo@outlook.com">bo yuan</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 May 2018 01:40:27 +0000</created>
                <updated>Mon, 18 May 2020 22:17:52 +0000</updated>
                            <resolved>Mon, 18 Jun 2018 16:49:15 +0000</resolved>
                                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1923648" author="nick.brewer" created="Mon, 18 Jun 2018 16:24:31 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;numYield&lt;/tt&gt; field does not represent how many results are being returned from a database query, it instead represents the number of times that the operation yielded in order to allow other operations to complete. This is fully explained in the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/database-profiler/#system.profile.numYield&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;database profiler documentation&lt;/a&gt;, and in the &lt;a href=&quot;https://docs.mongodb.com/manual/faq/concurrency/#faq-concurrency-yielding&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;concurrency documentation&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;From your responses, I do not see anything to indicate a bug in the MongoDB server. For MongoDB-related support discussion please post on the &lt;a href=&quot;https://groups.google.com/group/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user group&lt;/a&gt; or &lt;a href=&quot;https://stackoverflow.com/questions/tagged/mongodb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Stack Overflow with the &lt;tt&gt;mongodb&lt;/tt&gt; tag&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Nick&lt;/p&gt;



</comment>
                            <comment id="1897980" author="rambo_yuanbo@outlook.com" created="Tue, 22 May 2018 10:10:11 +0000"  >&lt;p&gt;I will create an index on the filed for the filter, but right now the&#160;numYields&#160; is weird.&lt;/p&gt;</comment>
                            <comment id="1897976" author="rambo_yuanbo@outlook.com" created="Tue, 22 May 2018 10:08:07 +0000"  >&lt;p&gt;Mr Fernandez,&lt;/p&gt;

&lt;p&gt;I&apos;m using v3.6.0&lt;/p&gt;

&lt;p&gt;Actually I cannot reproduce that situation today. Now with a simple find(), the iteration still freeze after doc 101, but the iteration can go on after a reasonable time now.&#160;&lt;/p&gt;

&lt;p&gt;However, here&apos;s another issue. Now i&apos;m doing a find() with a filter, for which quite many docs at the beginning of the collection do NOT satisfy, so understandably the iteration will wait for a long time before the first doc is yielded. BUT if i check the db with db.currentOp(), the mongo shell will show an increasing big numYields&#160; number for that op, while the cursor is not at all yielding any document. That is quite misleading. so why is that ?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks a lot!&lt;/p&gt;</comment>
                            <comment id="1897290" author="ramon.fernandez" created="Mon, 21 May 2018 17:26:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rambo_yuanbo%40outlook.com&quot; class=&quot;user-hover&quot; rel=&quot;rambo_yuanbo@outlook.com&quot;&gt;rambo_yuanbo@outlook.com&lt;/a&gt;, what version of MongoDB are you using? Have you checked the logs for information and the output of &lt;tt&gt;db.currentOp()&lt;/tt&gt; when this issue happens? Also if you have a reproducer that shows the behavior you describe if would be of great help if you could share it with us.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Ram&#243;n.&lt;/p&gt;</comment>
                            <comment id="1896593" author="rambo_yuanbo@outlook.com" created="Mon, 21 May 2018 01:53:37 +0000"  >&lt;p&gt;sorry, i cannot find how to edit the issue.&#160;&lt;/p&gt;

&lt;p&gt;After browsing other issues, i find i can go around the problem like :&lt;/p&gt;

&lt;p&gt;db.collection.find().batchSize(100).&lt;/p&gt;

&lt;p&gt;BUT it&apos;s still weird enough that the cursor will freeze and try to load the whole data if i don&apos;t explicitly ask for a&#160;batchSize.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1355120">SERVER-48283</issuekey>
        </issuelink>
                            </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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 21 May 2018 17:26:12 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 34 weeks, 2 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>phrenciuc@bitdefender.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 34 weeks, 2 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>rambo_yuanbo@outlook.com</customfieldvalue>
            <customfieldvalue>nick.brewer</customfieldvalue>
            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htykun:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htpl5j:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;ol&gt;
	&lt;li&gt;make any big collection. My collection contains 600, 000 + docs, each is about 100k in size.&lt;/li&gt;
	&lt;li&gt;make an simple query on it (db.collection.find())&lt;/li&gt;
	&lt;li&gt;iterate over the cursor returned&lt;/li&gt;
	&lt;li&gt;the iteration will wait for a very long time after 101 docs.&#160;&lt;/li&gt;
&lt;/ol&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|hty73z:</customfieldvalue>

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