<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:17:23 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-48531] 3 way deadlock can happen between chunk splitter, prepared transactions  and stepdown thread.</title>
                <link>https://jira.mongodb.org/browse/SERVER-48531</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently step down kills all conflicting user operations and some internal operations that are marked killable using&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/d00b75bfcac3ac74036ac6c2ceec4e8b42ac93a0/src/mongo/db/client.h#L220&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;setSystemOperationKillable.&lt;/a&gt;&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Write operation that takes global lock in IX and X mode.&lt;/li&gt;
	&lt;li&gt;Read operations that takes global lock in S mode.&lt;/li&gt;
	&lt;li&gt;Operations(read/write) that are blocked on prepare conflict.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Step down hangs due to below three way deadlock&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Chunk splitter thread (&lt;a href=&quot;https://github.com/mongodb/mongo/blob/d00b75bfcac3ac74036ac6c2ceec4e8b42ac93a0/src/mongo/db/s/chunk_splitter.cpp#L283&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_runAutosplit&lt;/a&gt;) performs read by holding RSTL in IX mode and is blocked by a prepared txn due to prepare conflict.&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/d00b75bfcac3ac74036ac6c2ceec4e8b42ac93a0/src/mongo/db/s/chunk_splitter.cpp#L63&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ChunkSplitter internal threads&lt;/a&gt;&#160;are not marked killable. So, step down won&apos;t be able to kill/interrupt those internal read operations.&lt;/li&gt;
	&lt;li&gt;Step down enqueues RSTL lock in X mode. And blocked behind chunk splitter internal thread.&lt;/li&gt;
	&lt;li&gt;CommitTransaction cmd is waiting for RSTL lock to acquire in IX mode but blocked behind the step down thread.&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="1368752">SERVER-48531</key>
            <summary>3 way deadlock can happen between chunk splitter, prepared transactions  and stepdown thread.</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="kshitij.gupta@mongodb.com">Kshitij Gupta</assignee>
                                    <reporter username="suganthi.mani@mongodb.com">Suganthi Mani</reporter>
                        <labels>
                            <label>bkp</label>
                            <label>sharding-interns-2020</label>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Mon, 1 Jun 2020 22:41:58 +0000</created>
                <updated>Sun, 29 Oct 2023 22:07:33 +0000</updated>
                            <resolved>Tue, 30 Jun 2020 03:54:49 +0000</resolved>
                                                    <fixVersion>4.4.1</fixVersion>
                    <fixVersion>4.7.0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="3321653" author="xgen-internal-githook" created="Wed, 5 Aug 2020 01:47:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kshitij Gupta&apos;, &apos;email&apos;: &apos;kshitij.gupta@mongodb.com&apos;, &apos;username&apos;: &apos;kshitijng&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48531&quot; title=&quot;3 way deadlock can happen between chunk splitter, prepared transactions  and stepdown thread.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48531&quot;&gt;&lt;del&gt;SERVER-48531&lt;/del&gt;&lt;/a&gt;: 3 way deadlock can happen between chunk splitter, prepared transactions and stepdown thread.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 1e23a0f7659d67df27ae8d553f99f35e52a91c0c)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a85277d4c53722830121cb3f447effa6cc70fd3d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a85277d4c53722830121cb3f447effa6cc70fd3d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3229432" author="xgen-internal-githook" created="Tue, 30 Jun 2020 03:53:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kshitij Gupta&apos;, &apos;email&apos;: &apos;kshitij.gupta@mongodb.com&apos;, &apos;username&apos;: &apos;kshitijng&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48531&quot; title=&quot;3 way deadlock can happen between chunk splitter, prepared transactions  and stepdown thread.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48531&quot;&gt;&lt;del&gt;SERVER-48531&lt;/del&gt;&lt;/a&gt;: 3 way deadlock can happen between chunk splitter, prepared transactions and stepdown thread.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1e23a0f7659d67df27ae8d553f99f35e52a91c0c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1e23a0f7659d67df27ae8d553f99f35e52a91c0c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3160647" author="suganthi.mani" created="Mon, 1 Jun 2020 22:48:10 +0000"  >&lt;p&gt;2 solution currently exists to fix this problem&lt;br/&gt;
1) Make&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/d00b75bfcac3ac74036ac6c2ceec4e8b42ac93a0/src/mongo/db/s/chunk_splitter.cpp#L283&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_runAutosplit&lt;/a&gt;() to set it&apos;s prepare conflict behavior as PrepareConflictBehavior::kIgnoreConflictsAllowWrites( something like&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/d00b75bfcac3ac74036ac6c2ceec4e8b42ac93a0/src/mongo/db/index_builds_coordinator.cpp#L2103&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this).&lt;/a&gt;&lt;br/&gt;
2) Mark the operations killable using&#160;setSystemOperationKillable (something like &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d00b75bfcac3ac74036ac6c2ceec4e8b42ac93a0/src/mongo/db/s/move_chunk_command.cpp#L151&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Note: Fix has to be backported till 4.2.&lt;br/&gt;
CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=matthew.saltz&quot; class=&quot;user-hover&quot; rel=&quot;matthew.saltz&quot;&gt;matthew.saltz&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></customfieldvalue>
    <customfieldvalue key="16775"><![CDATA[v4.2]]></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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000nDzNXQA0]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 26 Jun 2020 19:59:22 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 27 weeks, 1 day ago
                        </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>kshitij.gupta@mongodb.com</customfieldvalue>
            <customfieldvalue>suganthi.mani@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxo1lb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxb88f:</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="3956">Sharding 2020-06-15</customfieldvalue>
    <customfieldvalue id="3957">Sharding 2020-06-29</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|hxnnun:</customfieldvalue>

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