<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:43:33 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-36587] Committing a transaction which was started with a killCursors command can fail</title>
                <link>https://jira.mongodb.org/browse/SERVER-36587</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;tt&gt;AsyncResultsMerger::blockingKill()&lt;/tt&gt; sends a &lt;tt&gt;killCursors&lt;/tt&gt; command to each of its remotes. However, it &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd9cde58aefccf634322bfc662cb7f6980f6c1d2/src/mongo/s/query/async_results_merger.cpp#L686&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;discards the callback handle for the request&lt;/a&gt;, so &lt;tt&gt;blockingKill()&lt;/tt&gt; can return before the &lt;tt&gt;killCursors&lt;/tt&gt; command reaches the remote. This means that if the client issues a &lt;tt&gt;killCursors&lt;/tt&gt; command, and then a &lt;tt&gt;commitTransaction&lt;/tt&gt; command, a shard can receive the &lt;tt&gt;commitTransaction&lt;/tt&gt; before the &lt;tt&gt;killCursors&lt;/tt&gt;. This is problematic in combination with transactions. Consider the following sequence of events:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;User starts transaction 0 with &lt;tt&gt;killCursors&lt;/tt&gt; sent to mongos.&lt;/li&gt;
	&lt;li&gt;User receives ok response.&lt;/li&gt;
	&lt;li&gt;User sends &lt;tt&gt;commitTransaction&lt;/tt&gt; for transaction 0 to mongos.&lt;/li&gt;
	&lt;li&gt;mongod receives &lt;tt&gt;commitTransaction&lt;/tt&gt;, which fails since transaction 0 does not yet exist.&lt;/li&gt;
	&lt;li&gt;mongod receives &lt;tt&gt;killCursors&lt;/tt&gt;, which starts transaction 0.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Now the mongod is stuck with transaction 0 open.&lt;/p&gt;</description>
                <environment></environment>
        <key id="586583">SERVER-36587</key>
            <summary>Committing a transaction which was started with a killCursors command can fail</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="13201">Fixed</resolution>
                                        <assignee username="samy.lanka@mongodb.com">Samyukta Lanka</assignee>
                                    <reporter username="tess.avitabile@mongodb.com">Tess Avitabile</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Aug 2018 15:29:34 +0000</created>
                <updated>Sun, 29 Oct 2023 22:29:03 +0000</updated>
                            <resolved>Wed, 14 Nov 2018 21:02:00 +0000</resolved>
                                                    <fixVersion>4.1.6</fixVersion>
                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2062337" author="xgen-internal-githook" created="Wed, 14 Nov 2018 21:01:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Samy Lanka&apos;, &apos;email&apos;: &apos;samy.lanka@mongodb.com&apos;, &apos;username&apos;: &apos;lankas&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36587&quot; title=&quot;Committing a transaction which was started with a killCursors command can fail&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36587&quot;&gt;&lt;del&gt;SERVER-36587&lt;/del&gt;&lt;/a&gt; Disallow the first operation in a transaction to be killCursors&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c1d4e0b8e1a4c197aac2530259f78eb88fb4acd3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c1d4e0b8e1a4c197aac2530259f78eb88fb4acd3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1986976" author="david.storch" created="Mon, 27 Aug 2018 20:12:00 +0000"  >&lt;p&gt;Per in-person discussion with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;, we can imagine multiple ways to fix this:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Change the mongos &lt;tt&gt;killCursors&lt;/tt&gt; path to wait to hear back that the cursors on the all the shards have been killed. The current design is &quot;best effort&quot;---that is, the &lt;tt&gt;AsyncResultsMerger&lt;/tt&gt; issues &lt;tt&gt;killCursors&lt;/tt&gt; once on all of the remote cursors it manages, but it does not interpret the &lt;tt&gt;killCursors&lt;/tt&gt; responses or have retry logic in case there is a failure. This is typically not an issue in practice. In the unusual case that the cleanup logic fails and a cursor gets abandoned, it will eventually get reaped by a background job responsible for destroying idle cursors.&lt;/li&gt;
	&lt;li&gt;Prevent &lt;tt&gt;killCursors&lt;/tt&gt; commands from starting a transaction. The &lt;tt&gt;AsyncResultsMerger&lt;/tt&gt; is designed to issue &lt;tt&gt;killCursors&lt;/tt&gt; and &lt;tt&gt;getMore&lt;/tt&gt; commands to the shards asynchronously. This is only an issue for &lt;tt&gt;killCursors&lt;/tt&gt;, and not for &lt;tt&gt;getMore&lt;/tt&gt;, because a transaction cannot be successfully started with a &lt;tt&gt;getMore&lt;/tt&gt; command. There is no use case for opening a transaction with a &lt;tt&gt;killCursors&lt;/tt&gt; command, so we could make this an error as well.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;My preference is to pursue option #2. This work would fall on the replication team, so I&apos;m reassigning to repl for triage.&lt;/p&gt;</comment>
                            <comment id="1986587" author="david.storch" created="Mon, 27 Aug 2018 16:26:26 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt; can you elaborate on the problem? I&apos;m not sure I understand. Also, what&apos;s the impact of the problem? What bad thing does this cause?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="601154">SERVER-37045</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="634822">DOCS-12204</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>1.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>Mon, 27 Aug 2018 16:26:26 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 13 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 13 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>

                        </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>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>samy.lanka@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu578n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htxsif:</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="2605">Repl 2018-11-19</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|hu4thz:</customfieldvalue>

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