<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:43:15 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-36485] &#8216;killSessions&#8217; (for one session) and &apos;endSessions&apos; should return a &#8220;PreparedTransactionInProgress&#8221; error if it tries to kill a session that has a prepared transaction in it</title>
                <link>https://jira.mongodb.org/browse/SERVER-36485</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description></description>
                <environment></environment>
        <key id="584977">SERVER-36485</key>
            <summary>&#8216;killSessions&#8217; (for one session) and &apos;endSessions&apos; should return a &#8220;PreparedTransactionInProgress&#8221; error if it tries to kill a session that has a prepared transaction in it</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="misha.tyulenev@mongodb.com">Misha Tyulenev</assignee>
                                    <reporter username="judah.schvimer@mongodb.com">Judah Schvimer</reporter>
                        <labels>
                            <label>prepare_errors</label>
                    </labels>
                <created>Tue, 7 Aug 2018 16:00:13 +0000</created>
                <updated>Sun, 29 Oct 2023 22:29:13 +0000</updated>
                            <resolved>Wed, 16 Jan 2019 20:24:25 +0000</resolved>
                                                    <fixVersion>4.1.7</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2117505" author="xgen-internal-githook" created="Wed, 16 Jan 2019 20:22:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;mikety&apos;, &apos;email&apos;: &apos;misha@mongodb.com&apos;, &apos;name&apos;: &apos;Misha Tyulenev&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36485&quot; title=&quot;&#8216;killSessions&#8217; (for one session) and &amp;#39;endSessions&amp;#39; should return a &#8220;PreparedTransactionInProgress&#8221; error if it tries to kill a session that has a prepared transaction in it&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36485&quot;&gt;&lt;del&gt;SERVER-36485&lt;/del&gt;&lt;/a&gt; killSessions to ignore sessions with prepared transactions&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e5e108115f91a193bfd61f324a68d58c88e193a4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e5e108115f91a193bfd61f324a68d58c88e193a4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2102841" author="judah.schvimer" created="Wed, 2 Jan 2019 01:03:43 +0000"  >&lt;p&gt;This SGTM, if &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; agrees that doing nothing is acceptable (though maybe not ideal), then we&apos;ll de-prioritize this towards the end of the project. We definitely should at least test that prepared transactions cannot be killed with &lt;tt&gt;killSessions&lt;/tt&gt; as part of this ticket.&lt;/p&gt;</comment>
                            <comment id="2092586" author="tess.avitabile" created="Mon, 17 Dec 2018 15:30:12 +0000"  >&lt;p&gt;SGTM. I think we could also do nothing, since abortArbitraryTransaction() does not abort prepared transactions. But if it&apos;s helpful to avoid killing the operation context, then we can make that change.&lt;/p&gt;</comment>
                            <comment id="2092554" author="kaloian.manassiev" created="Mon, 17 Dec 2018 15:25:46 +0000"  >&lt;p&gt;OK great, in that case for this ticket we should implement the solution in (2) above: add a check &lt;a href=&quot;https://github.com/mongodb/mongo/blob/807c819591a0552b968672e284d4ec3bc84fa7de/src/mongo/db/kill_sessions_local.cpp#L92&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; that the transaction is not prepared, so that the operation context of any prepared transactions does not get interrupted accidentally, like we do with the expired transactions.&lt;/p&gt;</comment>
                            <comment id="2092474" author="tess.avitabile" created="Mon, 17 Dec 2018 15:10:21 +0000"  >&lt;p&gt;Re (2): I think it is acceptable for killSessions to silently ignore sessions with prepared transactions.&lt;/p&gt;

&lt;p&gt;Re (3): We are no longer planning to abort all transactions on FCV downgrade, so that call to killSessionsLocalKillTransactions will be removed. We have work planned to block FCV downgrade until there are no more prepared transactions:&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36497&quot; title=&quot;block returning from setFeatureCompatibilityVersion during 4.0 downgrade on all prepared transactions completing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36497&quot;&gt;&lt;del&gt;SERVER-36497&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2091590" author="kaloian.manassiev" created="Fri, 14 Dec 2018 22:23:54 +0000"  >&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/blob/807c819591a0552b968672e284d4ec3bc84fa7de/src/mongo/db/commands/end_sessions_command.cpp#L84&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;endSessions&lt;/tt&gt;&lt;/a&gt; command is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/807c819591a0552b968672e284d4ec3bc84fa7de/src/mongo/db/logical_session_cache_impl.cpp#L431&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;asynchronous&lt;/a&gt; and as such there is no way to return any value from it. Regardless of this though, if there is a prepared transaction on such a session, the session will not be ended regardless until the transaction commits, so this should not be a problem.&lt;/p&gt;

&lt;p&gt;For &lt;tt&gt;killSession&lt;/tt&gt; - it uses the SessionsKiller, which &lt;a href=&quot;https://github.com/mongodb/mongo/blob/807c819591a0552b968672e284d4ec3bc84fa7de/src/mongo/db/session_killer.cpp#L153&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;kills sessions&lt;/a&gt; in batches. Its &lt;a href=&quot;https://github.com/mongodb/mongo/blob/807c819591a0552b968672e284d4ec3bc84fa7de/src/mongo/db/session_killer.h#L62&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;return value&lt;/a&gt; doesn&apos;t convey anything about the individual sessions that were attempted to be killed and on top of that it can also aggregate killing sessions from different calls, so it is hard to pass any success or failure information back.&lt;/p&gt;

&lt;p&gt;I have a couple of questions:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;If we want &lt;tt&gt;killSessions&lt;/tt&gt; on the shards to be able to return some status on the session which was requested to be killed, the interface of the SessionsKiller will have to change. However, given that the same class is used between MongoS and MongoD I am not sure how easy that is to achieve. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=misha.tyulenev&quot; class=&quot;user-hover&quot; rel=&quot;misha.tyulenev&quot;&gt;misha.tyulenev&lt;/a&gt;?&lt;/li&gt;
	&lt;li&gt;Because of (1), I think it would be very difficult to implement this ticket as stated in the description, but if the intention is to just make sure neither of these commands will inadvertently abort a prepared transaction, then we can just add a check &lt;a href=&quot;https://github.com/mongodb/mongo/blob/807c819591a0552b968672e284d4ec3bc84fa7de/src/mongo/db/kill_sessions_local.cpp#L92&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; that the transaction is not prepared, like we do with the expired transactions. &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;?&lt;/li&gt;
	&lt;li&gt;Since &lt;tt&gt;killSessionsLocalKillTransactions&lt;/tt&gt; is also used on &lt;a href=&quot;https://github.com/mongodb/mongo/blob/807c819591a0552b968672e284d4ec3bc84fa7de/src/mongo/db/commands/feature_compatibility_version.cpp#L183&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;FCV downgrade&lt;/a&gt;, we will have to do some work in FCV downgrade to ensure that it drains all the prepared transactions and doesn&apos;t allow new ones to start. &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;, is there some FCV work to drain (or force-kill) prepared transactions on downgrade? As implemented now, they will be force-killed, which is probably not right.&lt;/li&gt;
&lt;/ol&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="610864">SERVER-37348</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="584978">SERVER-36486</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="635430">SERVER-38190</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="639674">SERVER-38297</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="621785">SERVER-37671</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="585020">SERVER-36497</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>6.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>Fri, 14 Dec 2018 22:23:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 4 weeks 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/WRITING-3447'>WRITING-3447</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-1032</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>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, 4 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>misha.tyulenev@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|hu4xdz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8ewn:</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="2448">Repl 2018-08-27</customfieldvalue>
    <customfieldvalue id="2726">Sharding 2019-01-28</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|hu4jnb:</customfieldvalue>

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