<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:33:45 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-76834] Circular wait dependency between PBWM and ticket acquisition</title>
                <link>https://jira.mongodb.org/browse/SERVER-76834</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Any thread which takes the PBWM &lt;b&gt;and&lt;/b&gt; a ticket has the potential to introduce a three-way deadlock in the presence of prepared transactions.&lt;/p&gt;

&lt;p&gt;The deadlock can be summarised like this:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;b&gt;T1 (Regular secondary read thread):&lt;/b&gt; N of them (where N == number of available tickets) acquire tickets, but end up waiting on a prepared transaction to commit. This transaction&apos;s commit happens to be in a subsequent batch, therefore this thread will not be unblocked until Oplog application makes forward progress.&lt;/li&gt;
	&lt;li&gt;&lt;b&gt;T2 (Internal thread):&lt;/b&gt; Takes the PBWM in some intent mode (IS) and blocks waiting on a ticket acquisition.&lt;/li&gt;
	&lt;li&gt;&lt;b&gt;T3 (Oplog application thread):&lt;/b&gt; Tries to take the PBWM in mode X, but blocks behind T2, which holds the PBWM.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;We now have a wait cycle of (T3) -&amp;gt; (T2) -&amp;gt; (T1) -&amp;gt; (T3).&lt;/p&gt;

&lt;p&gt;This demonstrates that it is not safe to block on a ticket acquisition while holding the PBWM and there are at least two places where this can happen:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/761e633ecc7382b9115cddf830dd625956e3a713/src/mongo/db/s/shard_filtering_metadata_refresh.cpp#L494-L495&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardFilteringMetadataRefresh&lt;/a&gt;: Takes both PBWM and a ticket&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/761e633ecc7382b9115cddf830dd625956e3a713/src/mongo/db/s/shard_server_catalog_cache_loader.cpp#L702-L705&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardServerCatalogCacheLoader&lt;/a&gt;: Takes both PBWM and a ticket&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This (more general) ticket is for the StorEx team to tighten up the locking rules in order to prevent deadlocks like these from being introduced. One possibility is to add an invariant that we can&apos;t take both PBWM and a ticket - a thread must choose one.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2331874">SERVER-76834</key>
            <summary>Circular wait dependency between PBWM and ticket acquisition</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="gregory.noma@mongodb.com">Gregory Noma</assignee>
                                    <reporter username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</reporter>
                        <labels>
                    </labels>
                <created>Thu, 4 May 2023 12:48:12 +0000</created>
                <updated>Fri, 1 Dec 2023 14:56:08 +0000</updated>
                            <resolved>Fri, 4 Aug 2023 18:32:39 +0000</resolved>
                                    <version>7.0.0-rc0</version>
                    <version>6.0.5</version>
                    <version>5.0.17</version>
                    <version>4.4.21</version>
                    <version>6.3.1</version>
                                    <fixVersion>7.1.0-rc0</fixVersion>
                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>14</watches>
                                                                                                                <comments>
                            <comment id="5614352" author="gregory.noma" created="Fri, 4 Aug 2023 18:32:39 +0000"  >&lt;p&gt;Now that we no longer take the PBWM as of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79391&quot; title=&quot;Stop taking PBWM with global lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79391&quot;&gt;&lt;del&gt;SERVER-79391&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79392&quot; title=&quot;Remove ParallelBatchWriterMode class&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79392&quot;&gt;&lt;del&gt;SERVER-79392&lt;/del&gt;&lt;/a&gt;, this issue should be fixed.&lt;/p&gt;</comment>
                            <comment id="5408268" author="connie.chen" created="Mon, 8 May 2023 14:26:27 +0000"  >&lt;p&gt;We will plan to backport this to 7.0, but we do not think this is a 7.0.0 blocker for code freeze since Kal is working on the known instance in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-76835&quot; title=&quot;Deadlock in the shard filtering metadata refresh path&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-76835&quot;&gt;&lt;del&gt;SERVER-76835&lt;/del&gt;&lt;/a&gt; and this is a preventative measure. Removing the &quot;7.0 required&quot; fixversion, but scheduling for next sprint. &lt;/p&gt;</comment>
                            <comment id="5402985" author="kaloian.manassiev" created="Fri, 5 May 2023 05:49:31 +0000"  >&lt;p&gt;This problem exists in all versions where the PBWM exists, but 7.0 would be the most impacted since it significantly lowered the number of available ticket. We will not backport the removal of the PBWM there, so that cannot be the solution. At the very least we should have a uassert somewhere if that happens so the server doesn&apos;t stall.&lt;/p&gt;

&lt;p&gt;I am removing the Epic and making it &quot;Related To&quot; to ensure this ticket shows up on StorEx&apos;s triage.&lt;/p&gt;</comment>
                            <comment id="5401118" author="JIRAUSER1253362" created="Thu, 4 May 2023 15:42:28 +0000"  >&lt;p&gt;We would rather remove the PBWM lock.&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">
                                        <issuelink>
            <issuekey id="2331876">SERVER-76835</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2513953">SERVER-83786</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2297497">SERVER-75262</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>4.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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25136"><![CDATA[Storage Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <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>Thu, 4 May 2023 15:42:28 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        26 weeks, 5 days 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2170</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>kaloian.manassiev@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            26 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>107.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>connie.chen@mongodb.com</customfieldvalue>
            <customfieldvalue>fausto.leyva@mongodb.com</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i27nof:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1574f:9</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="7183">Execution NAMR Team 2023-08-21</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|i279tr:</customfieldvalue>

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