<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:08:49 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-67698] Investigate potential deadlocks in LockState</title>
                <link>https://jira.mongodb.org/browse/SERVER-67698</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It seems that Resource Mutexes are &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fae8410364c1f02ee62e77076ef60b8ee418368f/src/mongo/db/concurrency/lock_state.cpp#L785&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;never released&lt;/a&gt; during a yield, this has the potential to lead to deadlocks as in the following case we would have one:&lt;/p&gt;

&lt;p&gt;Thread A takes Lock A -&amp;gt; Lock B -&amp;gt; Resource Mutex A&lt;/p&gt;

&lt;p&gt;Thread A yields&lt;/p&gt;

&lt;p&gt;Thread B takes Lock B -&amp;gt; Waits until Resource Mutex A is available&lt;/p&gt;

&lt;p&gt;Thread A wakes -&amp;gt; Lock A -&amp;gt; Wait until Lock B is available&lt;/p&gt;

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

&lt;p&gt;Additionally it seems that the order of the locks taken is broken when storing in the LockSnapshot &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fae8410364c1f02ee62e77076ef60b8ee418368f/src/mongo/db/concurrency/lock_state.cpp#L809&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. This is also unsafe, as it can cause deadlocks too as the order of locks when taken is potentially not the same after a yield and reacquiring them.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2080362">SERVER-67698</key>
            <summary>Investigate potential deadlocks in LockState</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="12300">Won&apos;t Do</resolution>
                                        <assignee username="geert.bosch@mongodb.com">Geert Bosch</assignee>
                                    <reporter username="jordi.olivares-provencio@mongodb.com">Jordi Olivares Provencio</reporter>
                        <labels>
                    </labels>
                <created>Thu, 30 Jun 2022 14:41:04 +0000</created>
                <updated>Mon, 1 Aug 2022 06:11:03 +0000</updated>
                            <resolved>Fri, 29 Jul 2022 17:02:42 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="4717177" author="allison.easton" created="Mon, 1 Aug 2022 06:11:03 +0000"  >&lt;p&gt;Sorry about that. No, it was for this ticket. During FCCV upgrade to 6.0, we are setting the orphan counts on the range deletion documents. To do this, we are using &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cf30383ac0182d5f45827319d172dfdf0957dc2f/src/mongo/db/s/range_deletion_util.cpp#L684-L692&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;an index scan&lt;/a&gt; with yield policy YIELD_AUTO. I left the comment here because this ticket came out of an investigation into whether we could be yielding during that scan, since it could result in incorrect orphan counts.&lt;/p&gt;

&lt;p&gt;It turned out not to be a problem, but that is because the lock we are using for that code &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cf30383ac0182d5f45827319d172dfdf0957dc2f/src/mongo/db/s/range_deletion_util.cpp#L662&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;takes an X resource lock&lt;/a&gt; which isn&apos;t yielded since resource mutexes aren&apos;t currently yielded.&lt;/p&gt;

&lt;p&gt;I just wanted to make sure that if we started yielding mutex locks, this code didn&apos;t start yielding and cause inaccurate orphan counts.&lt;/p&gt;</comment>
                            <comment id="4714954" author="connie.chen" created="Fri, 29 Jul 2022 17:03:06 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=allison.easton%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;allison.easton@mongodb.com&quot;&gt;allison.easton@mongodb.com&lt;/a&gt; - let us know if you meant for the above comment to be on another ticket?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="4650862" author="allison.easton" created="Thu, 30 Jun 2022 16:32:32 +0000"  >&lt;p&gt;Just adding a comment here to note that upgrade to 6.0 relies on this for orphan counts to be correct, so if this gets changed on 6.0 we should make sure this still works correctly.&lt;/p&gt;</comment>
                    </comments>
                    <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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 30 Jun 2022 16:32:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 27 weeks, 2 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_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>allison.easton@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 27 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>allison.easton@mongodb.com</customfieldvalue>
            <customfieldvalue>connie.chen@mongodb.com</customfieldvalue>
            <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>jordi.olivares-provencio@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i10m1z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0jgdc:</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_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|i1087b:</customfieldvalue>

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