<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:17:06 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-28090] Add ability to interrupt operations using pinned cursors on mongos</title>
                <link>https://jira.mongodb.org/browse/SERVER-28090</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If killCursor is called on the cursor, it is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.5.3/src/mongo/s/query/cluster_cursor_manager.cpp#L324&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;marked as &quot;killPending&quot;&lt;/a&gt;, and later &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.5.3/src/mongo/s/query/cluster_cursor_manager.cpp#L356-L408&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;reaped by the periodic ClusterCleanupCursorJob&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&quot;Reaping&quot; the ClusterClientCursor sends killCursors to all shards that have cursors on them as part of this sharded query.&lt;/p&gt;

&lt;p&gt;Currently, only one thread can use a ClusterClientCursor at a time, because the cursor must be &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.5.3/src/mongo/s/query/cluster_cursor_manager.cpp#L260-L270&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;checked out&quot; of the ClusterCursorManager&lt;/a&gt; to be used. This means if killCursor is called on the cursor while the cursor in use by a thread, the cursor is not killed by the reap thread until the first thread has finished getting a round of results from it and checked it back in.&lt;/p&gt;

&lt;p&gt;It would be preferable if it was possible to &quot;interrupt&quot; the ClusterClientCursor from the reap thread, by interrupting the operation which is using the cursor&apos;s operation context.&lt;/p&gt;

&lt;p&gt;This would mean the first thread would stop scheduling further requests to get results, and just wait for outstanding responses to return. This is much better than waiting for the entire round of results to complete.&lt;/p&gt;

&lt;p&gt;Currently, the AsyncResultsMerger (ARM) kind of supports being killed from a second thread: on ARM::kill(), it stops scheduling further requests as described above. However, if the thread doing kill() destroys the ClusterClientCursor after kill() returns, the first thread will have a reference to (and perhaps try to use) an invalid ClusterClientCursor, including an invalid ARM.&lt;/p&gt;

&lt;p&gt;The work in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27937&quot; title=&quot;pull apart the AsyncResultsMerger logic into (1) establishing the cursors (2) sending the getMore&amp;#39;s&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27937&quot;&gt;&lt;del&gt;SERVER-27937&lt;/del&gt;&lt;/a&gt;, which splits the ClusterClientCursor&apos;s implementation into a CursorEstablisher and ARM, will mean the first thread may have a reference to an invalid CursorEstablisher or invalid ARM.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev&quot;&gt;kaloian.manassiev&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="356817">SERVER-28090</key>
            <summary>Add ability to interrupt operations using pinned cursors on mongos</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="ian.boros@mongodb.com">Ian Boros</assignee>
                                    <reporter username="esha.maharishi@mongodb.com">Esha Maharishi</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 Feb 2017 22:57:06 +0000</created>
                <updated>Tue, 20 Feb 2018 14:52:09 +0000</updated>
                            <resolved>Wed, 14 Feb 2018 18:04:33 +0000</resolved>
                                    <version>3.5.3</version>
                                    <fixVersion>3.7.3</fixVersion>
                                    <component>Querying</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="1805075" author="xgen-internal-githook" created="Tue, 13 Feb 2018 23:30:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;ian.boros@10gen.com&apos;, &apos;name&apos;: &apos;Ian Boros&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28090&quot; title=&quot;Add ability to interrupt operations using pinned cursors on mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28090&quot;&gt;&lt;del&gt;SERVER-28090&lt;/del&gt;&lt;/a&gt; add ability to interrupt pinned cursors on mongos&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/30e5dded30c373f9519e4c5347f7a92a9fa2d59f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/30e5dded30c373f9519e4c5347f7a92a9fa2d59f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1772905" author="charlie.swanson" created="Fri, 12 Jan 2018 16:44:20 +0000"  >&lt;p&gt;This should be unblocked by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32307&quot; title=&quot;Make AsyncResultsMerger kill sequence issue killCursors without waiting for outstanding batches&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32307&quot;&gt;&lt;del&gt;SERVER-32307&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1518297" author="david.storch" created="Tue, 7 Mar 2017 21:10:20 +0000"  >&lt;p&gt;After discussing with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt;, I&apos;m going to mark this ticket as a dependency of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6496&quot; title=&quot;provide a way to kill a sharded query on all shards&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6496&quot;&gt;&lt;del&gt;SERVER-6496&lt;/del&gt;&lt;/a&gt;, which tracks the work required to kill sharded read operations easily across all shards. Ensuring that we can interrupt query execution of a mongos cursor in a timely fashion, rather than waiting until outstanding batches from the shards have been received over the network, is a required part of this work. Waiting for batches from the shards is not acceptable in sharded kill, as the this could take an arbitrarily long amount of time (e.g. a long-running query might be running).&lt;/p&gt;

&lt;p&gt;Similarly, we must make it possible to kill an in-use cursor on mongod. The mongod-side work is tracked by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21710&quot; title=&quot;Allow pinned ClientCursors to be killed on mongod&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21710&quot;&gt;&lt;del&gt;SERVER-21710&lt;/del&gt;&lt;/a&gt;, which is linked as related to this ticket.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="471776">SERVER-32307</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="44604">SERVER-6496</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="241653">SERVER-21710</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>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 7 Mar 2017 21:10:20 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-32307'>SERVER-32307</a></s>]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-943</customfieldvalue>
                        </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>
                            6 years, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>ian.boros@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht2vun:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8y9z:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="2117">Query 2018-02-12</customfieldvalue>
    <customfieldvalue id="2120">Query 2018-02-26</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|hs4fxz:</customfieldvalue>

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