<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:47: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-59673] Investigate better solutions for fixing the deadlock issue in profiling</title>
                <link>https://jira.mongodb.org/browse/SERVER-59673</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-59226&quot; title=&quot;Deadlock when stepping down with a profile session marked as uninterruptible&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-59226&quot;&gt;&lt;del&gt;SERVER-59226&lt;/del&gt;&lt;/a&gt;&#160;discovered a deadlock issue between the profiling operation and the replication state change. This ticket is created to investigate other proposed solutions that are more generic and Execution involved to remove the layer violation introduced in the original fix. One of the proposed solution is to avoid acquiring RSTL lock for profile(), or to be more generic, for all non-replicated writes. We should first investigate if RSTL acquisition can be safely removed for non-replicated writes and figure out how to remove it, probably by using a new RAII type. Another solution is to do profile in a separate thread or a dedicated thread pool. This approach may need async work queues and we need to investigate what to do when there are more profile requests than what can be fit into the queue. Also as a follow up, we might want to examine &lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt; use cases and see if that can be improved since we recently saw and increasing number of issues because of that.&#160;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1863386">SERVER-59673</key>
            <summary>Investigate better solutions for fixing the deadlock issue in profiling</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="jordi.olivares-provencio@mongodb.com">Jordi Olivares Provencio</assignee>
                                    <reporter username="wenbin.zhu@mongodb.com">Wenbin Zhu</reporter>
                        <labels>
                            <label>techdebt</label>
                    </labels>
                <created>Mon, 30 Aug 2021 18:55:39 +0000</created>
                <updated>Sun, 29 Oct 2023 21:49:05 +0000</updated>
                            <resolved>Fri, 2 Dec 2022 17:23:05 +0000</resolved>
                                                    <fixVersion>6.3.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>15</watches>
                                                                                                                <comments>
                            <comment id="5025534" author="xgen-internal-githook" created="Fri, 2 Dec 2022 15:56:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Olivares Provencio&apos;, &apos;email&apos;: &apos;jordi.olivares-provencio@mongodb.com&apos;, &apos;username&apos;: &apos;jordiolivares&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-59673&quot; title=&quot;Investigate better solutions for fixing the deadlock issue in profiling&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-59673&quot;&gt;&lt;del&gt;SERVER-59673&lt;/del&gt;&lt;/a&gt; Exclude profiling from taking RSTL lock&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/8debef920f2151e833d6ba524c13c4c7b89eeebf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/8debef920f2151e833d6ba524c13c4c7b89eeebf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4845287" author="JIRAUSER1264163" created="Wed, 21 Sep 2022 14:54:37 +0000"  >&lt;p&gt;One option that is quite simple to implement is to define a list of collections which we know are not concerned by the ReplicaSet state changes and to skip the RSTL lock for them. Inside AutoGetCollection we can easily check for membership. Initially we would include the &lt;tt&gt;system.profile&lt;/tt&gt; collection but it could be easily expanded in the future.&lt;/p&gt;

&lt;p&gt;This option also serves as documentation for which collections are used in replication.&lt;/p&gt;</comment>
                            <comment id="4072779" author="samy.lanka" created="Mon, 20 Sep 2021 21:01:42 +0000"  >&lt;p&gt;Even if we can&apos;t remove &lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt; in the near future, we might want to audit its current uses to see if a similar bug is possible with other operations.&lt;/p&gt;</comment>
                            <comment id="4072638" author="JIRAUSER1258790" created="Mon, 20 Sep 2021 20:22:37 +0000"  >&lt;p&gt;Probably not part of this ticket, but maybe also consider filing another ticket to completely remove &lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt;?&#160;&lt;/p&gt;</comment>
                            <comment id="4060358" author="schwerin" created="Tue, 14 Sep 2021 20:35:02 +0000"  >&lt;p&gt;We don&apos;t know ahead of time which operations we will record the profile&lt;br/&gt;
information for, and we don&apos;t want any lock acquisition costs for the&lt;br/&gt;
profiling to show up in the profile. The times we care are exactly when&lt;br/&gt;
something is taking long that shouldn&apos;t or there are conflicts that are&lt;br/&gt;
unexpected.&lt;/p&gt;

&lt;p&gt;On Tue, Sep 14, 2021 at 4:24 PM Louis Williams (Jira) &amp;lt;jira@mongodb.org&amp;gt;&lt;/p&gt;
</comment>
                            <comment id="4060310" author="louis.williams" created="Tue, 14 Sep 2021 20:23:28 +0000"  >&lt;p&gt;In this case, operations should know that they need to profile ahead of time, and they can acquire all the locks that they need up-front. There should be no consequence of holding a lock on the profile collection for an extended period of time, because there should be no conflicting operations on the profile collection, especially after &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-55034&quot; title=&quot;The profile command should not take S or X database locks&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-55034&quot;&gt;&lt;del&gt;SERVER-55034&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="4060059" author="schwerin" created="Tue, 14 Sep 2021 19:17:50 +0000"  >&lt;p&gt;I agree that pattern exists, but I don&apos;t think this quite matches the pattern, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt;. The cleanup tasks here actually require a completely separate set of locks from the &quot;do something&quot;. The &quot;cleanup task&quot; is writing the profile result, which is intentionally considered separate work from the operation itself.&lt;/p&gt;</comment>
                            <comment id="4059579" author="gregory.noma" created="Tue, 14 Sep 2021 18:19:41 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt; just spitballing: maybe something like registering a callback when taking a lock which will run before the lock is released in those scenarios?&lt;/p&gt;</comment>
                            <comment id="4059519" author="louis.williams" created="Tue, 14 Sep 2021 18:08:53 +0000"  >&lt;p&gt;This is just one example of a common, yet problematic pattern that we have throughout the server: &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;An operation acquires locks&lt;/li&gt;
	&lt;li&gt;The operation is interrupted/times out/conflicts with a state transition. An exception propagates such that the locks are released, but this operation needs to perform some cleanup task that requires a lock.&lt;/li&gt;
	&lt;li&gt;This lock is no longer available because the operation has been interrupted (i.e. cannot acquire more locks) or there is a conflicting operation (i.e. stepDown).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The solutions currently are: 1) block until the lock is available and ignoring interrupts (i.e. UninterruptibleLockGuard) or 2) skip the cleanup, which could leak resources. In the case of this ticket, that would mean not profile anything. &lt;/p&gt;

&lt;p&gt;We need this pattern more often:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Acquire locks&lt;/li&gt;
	&lt;li&gt;Do something&lt;/li&gt;
	&lt;li&gt;Perform cleanup with locks&lt;/li&gt;
	&lt;li&gt;Release locks&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2191845">SERVER-71536</issuekey>
        </issuelink>
                            </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="1974365">SERVER-63143</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2200499">SERVER-71786</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1847496">SERVER-59226</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2188517">SERVER-71440</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>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8.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, 14 Sep 2021 18:08:53 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 9 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-2883</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>
                            1 year, 9 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>145.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
            <customfieldvalue>jordi.olivares-provencio@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>samy.lanka@mongodb.com</customfieldvalue>
            <customfieldvalue>wenbin.zhu@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzzrsv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0jf9z:d8</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="5979">Execution Team 2022-05-02</customfieldvalue>
    <customfieldvalue id="5980">Execution Team 2022-05-16</customfieldvalue>
    <customfieldvalue id="6331">Execution Team 2022-10-03</customfieldvalue>
    <customfieldvalue id="6332">Execution Team 2022-10-17</customfieldvalue>
    <customfieldvalue id="6333">Execution Team 2022-10-31</customfieldvalue>
    <customfieldvalue id="6492">Execution Team 2022-11-14</customfieldvalue>
    <customfieldvalue id="6554">Execution Team 2022-12-12</customfieldvalue>
    <customfieldvalue id="6579">Execution Team 2022-11-28</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|hzze1j:</customfieldvalue>

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