<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:49:00 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-38456] killSessionsLocalKillTransactions must filter for sessions with running transactions</title>
                <link>https://jira.mongodb.org/browse/SERVER-38456</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In stepdown, we enqueue an RSTL X lock and then kill all running transactions by calling &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7f5dd2e6158613c20cc03692f099e6036aa7e5e1/src/mongo/db/repl/replication_state_transition_lock_guard.cpp#L58&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;killSessionsLocalKillTransactions()&lt;/tt&gt;&lt;/a&gt;. This visits every session in the session catalog, kills the operation that has the session checked out, waits for the session to be checked in, checks out the session, then aborts any running transaction. However, if the operation is a retryable write, then it can perform query yielding, which reacquires locks in an &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7f5dd2e6158613c20cc03692f099e6036aa7e5e1/src/mongo/db/query/query_yield.cpp#L92&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt;&lt;/a&gt;. An operation cannot be killed while it is in an &lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt;, and it will not check the session back in until it has reacquired the lock (which it cannot, since there is an RSTL X lock enqueued). This problem also occurred when the Global X lock was used to guard state transitions.&lt;/p&gt;

&lt;p&gt;I recommend solving this by changing the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7f5dd2e6158613c20cc03692f099e6036aa7e5e1/src/mongo/db/query/query_yield.cpp#L92&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;filter&lt;/a&gt; that &lt;tt&gt;killSessionsLocalKillTransactions()&lt;/tt&gt; supplies to &lt;tt&gt;killSessionsAction()&lt;/tt&gt; so that it only attempts to visit operations with running multi-document transactions. Multi-document transactions never yield locks, so they will not attempt to reacquire locks in an &lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="647369">SERVER-38456</key>
            <summary>killSessionsLocalKillTransactions must filter for sessions with running transactions</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="kaloian.manassiev@mongodb.com">Kaloian Manassiev</assignee>
                                    <reporter username="tess.avitabile@mongodb.com">Tess Avitabile</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Dec 2018 16:54:23 +0000</created>
                <updated>Sun, 29 Oct 2023 22:26:01 +0000</updated>
                            <resolved>Thu, 7 Mar 2019 04:20:35 +0000</resolved>
                                                    <fixVersion>4.1.9</fixVersion>
                                    <component>Replication</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2173753" author="xgen-internal-githook" created="Thu, 7 Mar 2019 04:19:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kaloian Manassiev&apos;, &apos;username&apos;: &apos;kaloianm&apos;, &apos;email&apos;: &apos;kaloian.manassiev@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38456&quot; title=&quot;killSessionsLocalKillTransactions must filter for sessions with running transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38456&quot;&gt;&lt;del&gt;SERVER-38456&lt;/del&gt;&lt;/a&gt; On shutdown, stepdown and FCV downgrade only kill sessions with multi-statement transactions&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f7492fe762273c1fa41d68275407ca08d1d6a970&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f7492fe762273c1fa41d68275407ca08d1d6a970&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2087754" author="tess.avitabile" created="Tue, 11 Dec 2018 22:30:38 +0000"  >&lt;p&gt;A retryable write can also scan many documents, looking for the first matching document to update. They would yield in that scan.&lt;/p&gt;</comment>
                            <comment id="2087686" author="siyuan.zhou@10gen.com" created="Tue, 11 Dec 2018 21:52:04 +0000"  >&lt;p&gt;The reads in retryable writes are reading transaction table and the oplog, right? They should be fairly cheap. Is disabling yielding an option for that?&lt;/p&gt;</comment>
                            <comment id="2084608" author="kaloian.manassiev" created="Fri, 7 Dec 2018 22:45:03 +0000"  >&lt;p&gt;Spoke with Tess in person and found out that only retryable writes check-out the session, regular operations outside of transaction don&apos;t.&lt;/p&gt;

&lt;p&gt;Because of this, making all yield code paths check-in the session is a bit of an overkill and also goes against future plans for replication to not kill read operations.&lt;/p&gt;

&lt;p&gt;The simplest solution would be for the &lt;tt&gt;killSessionsLocalKillTransactions()&lt;/tt&gt; call to only consider TransactionParticipants which are running a session.&lt;/p&gt;</comment>
                            <comment id="2084556" author="kaloian.manassiev" created="Fri, 7 Dec 2018 22:14:11 +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;, a retryable write operation is no different from a find and they both can yield and lead to the same uninterruptability, can&apos;t they? A solution where we inspect the type of TransactionParticipant on the session is also racy, because there is no guarantee whether we will catch the retryable write before or after it has yielded.&lt;/p&gt;

&lt;p&gt;We had discussed previously about query yielding to check-in the session - would this work?&lt;/p&gt;

&lt;p&gt;Another alternative that just occurred to me while talking to Siyuan was to have a different kind of uninterruptability, which is effectively &quot;I am ok with yielding my place in the queue and letting other operations jump in-front of me, but I can&apos;t stop waiting&quot;. Effectively it will be a loop where we wait for lock reacquisition and if we get &quot;Interrupted&quot; we yield the locks and continue waiting. I would like to think about this a bit more, but what do you think about just checking in the session at yield time?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1754718">SERVER-57167</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.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, 7 Dec 2018 22:14:11 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 49 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>
                            4 years, 49 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>62.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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@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|huf5pb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu5a5z:</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="2725">Sharding 2019-01-14</customfieldvalue>
    <customfieldvalue id="2726">Sharding 2019-01-28</customfieldvalue>
    <customfieldvalue id="2786">Sharding 2019-02-11</customfieldvalue>
    <customfieldvalue id="2787">Sharding 2019-02-25</customfieldvalue>
    <customfieldvalue id="2824">Sharding 2019-03-11</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|hueryn:</customfieldvalue>

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