<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:55:41 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>[JAVA-1854] Driver tries to kill a cursor twice when limit is reached on the first batch</title>
                <link>https://jira.mongodb.org/browse/JAVA-1854</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We have updated our java mongo driver from 2.13.0 to 3.0.2, and since then, we have tons of &quot;killcursors: found 0 of 1&quot; in logs on our secondary servers&lt;/p&gt;

&lt;p&gt;Before the change, we had around 500 logs per hours of it :&lt;/p&gt;

&lt;p&gt;$ sudo grep 2015-06-09T14 /var/log/mongodb/mongodb.log | grep -c killcursors&lt;br/&gt;
511&lt;/p&gt;

&lt;p&gt;since the change, we have around 150 times more of this log :&lt;/p&gt;

&lt;p&gt;sudo grep 2015-06-09T18 /var/log/mongodb/mongodb.log | grep -c killcursors&lt;br/&gt;
78043&lt;/p&gt;

&lt;p&gt;After the rollback, these logs disapeared&lt;/p&gt;</description>
                <environment>linux Ubuntu 14.04.2 LTS</environment>
        <key id="209690">JAVA-1854</key>
            <summary>Driver tries to kill a cursor twice when limit is reached on the first batch</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="jpcaruana">Jean-Philippe Caruana</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Jun 2015 09:03:17 +0000</created>
                <updated>Wed, 13 Apr 2016 21:03:12 +0000</updated>
                            <resolved>Wed, 10 Jun 2015 16:13:32 +0000</resolved>
                                    <version>3.0.2</version>
                                    <fixVersion>3.0.3</fixVersion>
                                    <component>Query Operations</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="967895" author="jeff.yemin" created="Thu, 16 Jul 2015 16:01:11 +0000"  >&lt;p&gt;Fix is now available in the &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/releases/tag/r3.0.3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;3.0.3 release&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="937433" author="jpcaruana" created="Thu, 11 Jun 2015 08:53:30 +0000"  >&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;kill cursors doesn&apos;t seem to be that free:&lt;/p&gt;

&lt;p&gt;2015-06-11T10:48:28.805+0200 I QUERY    &lt;span class=&quot;error&quot;&gt;&amp;#91;conn471194&amp;#93;&lt;/span&gt; killcursors  keyUpdates:0 writeConflicts:0 numYields:0 locks:{ Global: { acquireCount: &lt;/p&gt;
{ r: 1 }
&lt;p&gt; }, Database: { acquireCount: &lt;/p&gt;
{ r: 1 }
&lt;p&gt; }, Collection: { acquireCount: &lt;/p&gt;
{ r: 1 }
&lt;p&gt; } } 769ms&lt;/p&gt;</comment>
                            <comment id="936514" author="xgen-internal-githook" created="Wed, 10 Jun 2015 16:11:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: Avoid redundant killing of the cursor by setting a flag indicating that it&apos;s already been killed.&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1854&quot; title=&quot;Driver tries to kill a cursor twice when limit is reached on the first batch&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1854&quot;&gt;&lt;del&gt;JAVA-1854&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: 3.0.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/1cb4b30368af4ca12a1a2e6e86f031a4cb82ebca&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/1cb4b30368af4ca12a1a2e6e86f031a4cb82ebca&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="936506" author="xgen-internal-githook" created="Wed, 10 Jun 2015 16:07:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: Avoid redundant killing of the cursor by setting a flag indicating that it&apos;s already been killed.&lt;/p&gt;

&lt;p&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1854&quot; title=&quot;Driver tries to kill a cursor twice when limit is reached on the first batch&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1854&quot;&gt;&lt;del&gt;JAVA-1854&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/e11b52d1691e490146446d2a1de8a883165558fa&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/e11b52d1691e490146446d2a1de8a883165558fa&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="936462" author="jeff.yemin" created="Wed, 10 Jun 2015 15:38:58 +0000"  >&lt;p&gt;OK, thanks.  I&apos;m going to edit the description to reflect what we know for sure, to avoid any confusion for anyone else looking at this issue.&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                            <comment id="936445" author="jpcaruana" created="Wed, 10 Jun 2015 15:32:09 +0000"  >&lt;p&gt;You might be right: a lot of things happened at this time in production.&lt;/p&gt;

&lt;p&gt;What we experienced is a much slower read rate, but I have nothing serious to prove this came from the new driver version. The best I can say is that we&apos;ll try the new driver version and see if we still have performance issues.&lt;/p&gt;</comment>
                            <comment id="936435" author="jeff.yemin" created="Wed, 10 Jun 2015 15:27:05 +0000"  >&lt;p&gt;I have a strong feeling that this bug is not the cause of the performance degradation that you experienced, as a no-op kill cursor should not be a particularly expensive operation.  Can you describe the symptoms of that degradation in some more detail?&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                            <comment id="936376" author="jpcaruana" created="Wed, 10 Jun 2015 14:49:53 +0000"  >&lt;p&gt;Thanks Jeff&lt;/p&gt;</comment>
                            <comment id="936371" author="jeff.yemin" created="Wed, 10 Jun 2015 14:48:04 +0000"  >&lt;p&gt;Hi Jean-Phillipe,&lt;/p&gt;

&lt;p&gt;I found a bug that could be responsible for the increase in log messages that you have experienced.  The bug would show up on queries where a limit is being set.  I&apos;ll get a fix pushed out to a SNAPSHOT build as soon as possible.&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;
</comment>
                            <comment id="936293" author="jpcaruana" created="Wed, 10 Jun 2015 13:49:09 +0000"  >&lt;p&gt;Hi Jeff,&lt;/p&gt;

&lt;p&gt;I attached server logs as you requested.&lt;/p&gt;

&lt;p&gt;I sadly could not reproduce this in a non production env (it wouldn&apos;t have made it to production otherwise): logs look the same as in the 2.13.0.log attached file.&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;</comment>
                            <comment id="936275" author="jeff.yemin" created="Wed, 10 Jun 2015 13:30:14 +0000"  >&lt;p&gt;Hi Jean-Phillipe,&lt;/p&gt;

&lt;p&gt;Can you attach the relevant sever logs please?  One representative sample from when you were running with 2.13.0, and one with 3.0.2.&lt;/p&gt;

&lt;p&gt;Are you able to reproduce this in a non-production environment?  If so, we may be able to glean some more information by turning up the log level in the 3.0 driver, as all OP_KILL_CURSOR messages are logged at debug by a logger named &quot;org.mongodb.driver.protocol.killcursor&quot;.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                            <comment id="936127" author="jpcaruana" created="Wed, 10 Jun 2015 09:09:52 +0000"  >&lt;p&gt;SECONDARY&amp;gt; db.version()&lt;br/&gt;
3.0.2&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="77410" name="2.13.0.log" size="1451" author="jpcaruana" created="Wed, 10 Jun 2015 13:49:09 +0000"/>
                            <attachment id="77411" name="3.0.2.log" size="2134" author="jpcaruana" created="Wed, 10 Jun 2015 13:49:09 +0000"/>
                            <attachment id="77546" name="killCursor.txt" size="238" author="jpcaruana" created="Thu, 11 Jun 2015 08:54:12 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsa6lj:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="586">Java Sprint 21</customfieldvalue>

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