<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:55: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-84468] Fix deadlock when running runTransactionOnShardingCatalog()</title>
                <link>https://jira.mongodb.org/browse/SERVER-84468</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The function &lt;a href=&quot;https://github.com/10gen/mongo/blob/28334e6ae1cd3d538be4e7c71eba673a6f31478b/src/mongo/db/s/sharding_ddl_util.cpp#L870&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;runTransactionOnShardingCatalog()&lt;/a&gt; is called when a config server operation needs to execute an internal transaction.&lt;/p&gt;

&lt;p&gt;This function creates a new &lt;tt&gt;OperationContext&lt;/tt&gt; under an &lt;tt&gt;AlternativeClientServer&lt;/tt&gt; that is &lt;a href=&quot;https://github.com/10gen/mongo/blob/28334e6ae1cd3d538be4e7c71eba673a6f31478b/src/mongo/db/s/sharding_ddl_util.cpp#L893&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set as interruptible&lt;/a&gt; a few lines below &lt;a href=&quot;https://github.com/10gen/mongo/blob/28334e6ae1cd3d538be4e7c71eba673a6f31478b/src/mongo/db/s/sharding_ddl_util.cpp#L889&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;its creation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If the OperationContext got killed by the stepdown thread right before setting it as interruptible, we would end up in a deadlock. This is the event sequence for a deadlock:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_blue.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Under runTransactionOnShardingCatalog(), &lt;a href=&quot;https://github.com/10gen/mongo/blob/28334e6ae1cd3d538be4e7c71eba673a6f31478b/src/mongo/db/s/sharding_ddl_util.cpp#L889&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;create a new OperationContext&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_green.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Step-down thread kicks in and kills the recently created OperationContext, but it&apos;s not killed because it &lt;a href=&quot;https://github.com/10gen/mongo/blob/5c8a2a8720eb6f8fb31afce29d392a730a197bb9/src/mongo/db/repl/replication_coordinator_impl.cpp#L2595-L2597&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;doesn&apos;t meet the conditions to be killed&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_blue.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; The new OperationContext is &lt;a href=&quot;https://github.com/10gen/mongo/blob/28334e6ae1cd3d538be4e7c71eba673a6f31478b/src/mongo/db/s/sharding_ddl_util.cpp#L893&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set as interruptible&lt;/a&gt; (but late).&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_blue.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; The internal transaction &lt;a href=&quot;https://github.com/10gen/mongo/blob/a63b92c90fa455a08b4e638fcead2c95d50a289d/src/mongo/db/transaction/transaction_api.cpp#L1000-L1024&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;checks out a session&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_green.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Step-down thread &lt;a href=&quot;https://github.com/10gen/mongo/blob/6b19e54d461bab075ade6e3e05767a881ee37597/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp#L551&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;acquires the RSTL lock&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_green.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; Step-down thread &lt;a href=&quot;https://github.com/10gen/mongo/blob/6b19e54d461bab075ade6e3e05767a881ee37597/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp#L567&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;checks out all the active sessions to kill them&lt;/a&gt;. Gets stuck here since one session is still checked out by the non-interrupted thread.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_blue.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; The internal transaction tries to &lt;a href=&quot;https://github.com/10gen/mongo/blob/e1db0aeed09e91ee91932cb11c0b36b8058e4849/src/mongo/db/service_entry_point_common.cpp#L1638&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;get the RSTL lock here&lt;/a&gt; and gets stuck.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2534958">SERVER-84468</key>
            <summary>Fix deadlock when running runTransactionOnShardingCatalog()</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="silvia.surroca@mongodb.com">Silvia Surroca</assignee>
                                    <reporter username="silvia.surroca@mongodb.com">Silvia Surroca</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Jan 2024 11:03:17 +0000</created>
                <updated>Wed, 3 Jan 2024 14:16:13 +0000</updated>
                            <resolved>Wed, 3 Jan 2024 08:06:01 +0000</resolved>
                                    <version>7.0.0</version>
                    <version>7.3.0-rc0</version>
                    <version>7.2.0</version>
                                    <fixVersion>7.2.1</fixVersion>
                    <fixVersion>7.3.0-rc0</fixVersion>
                    <fixVersion>7.0.6</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5982766" author="xgen-internal-githook" created="Wed, 3 Jan 2024 13:26:13 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Silvia Surroca&apos;, &apos;email&apos;: &apos;silvia.surroca@mongodb.com&apos;, &apos;username&apos;: &apos;silviasuhu&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-84468&quot; title=&quot;Fix deadlock when running runTransactionOnShardingCatalog()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-84468&quot;&gt;&lt;del&gt;SERVER-84468&lt;/del&gt;&lt;/a&gt; Fix deadlock when running runTransactionOnShardingCatalog() (#17821)&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 30410c6458fc965ae1277e78a2313e59a4e5d24f)&lt;/p&gt;

&lt;p&gt;GitOrigin-RevId: c5231702cf05da78b094eb351d9e2dff95538113&lt;br/&gt;
Branch: v7.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/43d9974fe17b936beadf8179f8dc65e0fbbcba8e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/43d9974fe17b936beadf8179f8dc65e0fbbcba8e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5982746" author="xgen-internal-githook" created="Wed, 3 Jan 2024 13:18:05 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Silvia Surroca&apos;, &apos;email&apos;: &apos;silvia.surroca@mongodb.com&apos;, &apos;username&apos;: &apos;silviasuhu&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-84468&quot; title=&quot;Fix deadlock when running runTransactionOnShardingCatalog()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-84468&quot;&gt;&lt;del&gt;SERVER-84468&lt;/del&gt;&lt;/a&gt; Fix deadlock when running runTransactionOnShardingCatalog() (#17821)&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 30410c6458fc965ae1277e78a2313e59a4e5d24f)&lt;br/&gt;
Branch: v7.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/40808dc197f45300468e3e0f8802b3740516b0fd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/40808dc197f45300468e3e0f8802b3740516b0fd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5980630" author="xgen-internal-githook" created="Tue, 2 Jan 2024 17:53:53 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Silvia Surroca&apos;, &apos;email&apos;: &apos;silvia.surroca@mongodb.com&apos;, &apos;username&apos;: &apos;silviasuhu&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-84468&quot; title=&quot;Fix deadlock when running runTransactionOnShardingCatalog()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-84468&quot;&gt;&lt;del&gt;SERVER-84468&lt;/del&gt;&lt;/a&gt; Fix deadlock when running runTransactionOnShardingCatalog() (#17821)&lt;/p&gt;

&lt;p&gt;GitOrigin-RevId: 30410c6458fc965ae1277e78a2313e59a4e5d24f&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5af259b4e6dde01213b6108c2933397855634290&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5af259b4e6dde01213b6108c2933397855634290&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="2329910">SERVER-76749</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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26553"><![CDATA[v7.2]]></customfieldvalue>
    <customfieldvalue key="25578"><![CDATA[v7.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, 2 Jan 2024 13:01:06 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>26.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>silvia.surroca@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i36crb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2o3mc:</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="7892">CAR Team 2024-01-08</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|i35ywn:</customfieldvalue>

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