<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:50:58 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-60872] Deadlock between stepDown and TenantOplogApplier startup</title>
                <link>https://jira.mongodb.org/browse/SERVER-60872</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;stepDown thread: Holding &lt;a href=&quot;https://github.com/mongodb/mongo/blob/05f457975d489ad2261615053f185b2f14aed218/src/mongo/db/repl/replication_coordinator_impl.cpp#L2687&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RSTL&lt;/a&gt;, blocked on &lt;tt&gt;TenantMigrationRecipientService::Instance&lt;/tt&gt; mutex via &lt;a href=&quot;https://github.com/mongodb/mongo/blob/05f457975d489ad2261615053f185b2f14aed218/src/mongo/db/repl/primary_only_service.cpp#L415&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;interrupt&lt;/tt&gt;&lt;/a&gt;&lt;br/&gt;
 recipientService thread: Holding &lt;tt&gt;TenantMigrationRecipientService::Instance&lt;/tt&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/05f457975d489ad2261615053f185b2f14aed218/src/mongo/db/repl/tenant_migration_recipient_service.cpp#L2227-L2230&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mutex&lt;/a&gt;, blocked on RSTL via &lt;a href=&quot;https://github.com/mongodb/mongo/blob/05f457975d489ad2261615053f185b2f14aed218/src/mongo/db/repl/tenant_oplog_batcher.cpp#L265&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;TenantOplogBatcher-&amp;gt;startup()&lt;/tt&gt;&lt;/a&gt; and the opCtx wasn&apos;t interrupted&#160;because the&#160;&lt;tt&gt;PrimaryOnlyService&lt;/tt&gt;&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/05f457975d489ad2261615053f185b2f14aed218/src/mongo/db/repl/primary_only_service.cpp#L414-L421&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;interrupts instances first before killing opCtxs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We should also confirm that we don&#8217;t have a similar deadlock pattern elsewhere  in the tenant migration donor or recipient code when making op ctx under a mutex.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1904005">SERVER-60872</key>
            <summary>Deadlock between stepDown and TenantOplogApplier startup</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-serverless">[DO NOT USE] Backlog - Server Serverless</assignee>
                                    <reporter username="lingzhi.deng@mongodb.com">Lingzhi Deng</reporter>
                        <labels>
                            <label>serverless-shortlist</label>
                    </labels>
                <created>Wed, 20 Oct 2021 22:40:44 +0000</created>
                <updated>Fri, 6 Oct 2023 15:03:49 +0000</updated>
                            <resolved>Fri, 6 Oct 2023 15:03:49 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="5259082" author="JIRAUSER1262830" created="Wed, 8 Mar 2023 16:30:33 +0000"  >&lt;p&gt;Moving this back to open as work was deprioritized and we didn&apos;t merge the PR.&lt;/p&gt;</comment>
                            <comment id="5023526" author="steven.vannelli" created="Thu, 1 Dec 2022 20:41:03 +0000"  >&lt;p&gt;Removing from the sprint while Chris finishes up his other tickets. &lt;/p&gt;</comment>
                            <comment id="4967017" author="suganthi.mani" created="Wed, 9 Nov 2022 14:58:09 +0000"  >&lt;p&gt;Spoke with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jason.chan%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;jason.chan@mongodb.com&quot;&gt;jason.chan@mongodb.com&lt;/a&gt;&#160;and&#160;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=george.wangensteen%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;george.wangensteen@mongodb.com&quot;&gt;george.wangensteen@mongodb.com&lt;/a&gt;, we decided to do a short-term quick fix&#160;as part of this ticket. This should address both the deadlock bugs mentioned in this ticket. And, created&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-71207&quot; title=&quot;Lock ordering violation between POS mutex lock and instance mutex lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-71207&quot;&gt;SERVER-71207&lt;/a&gt; to think of a long-term solution and assigned to Service Arch team.&lt;/p&gt;</comment>
                            <comment id="4960542" author="steven.vannelli" created="Mon, 7 Nov 2022 19:19:36 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=suganthi.mani%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;suganthi.mani@mongodb.com&quot;&gt;suganthi.mani@mongodb.com&lt;/a&gt; - to sync up with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jason.chan%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;jason.chan@mongodb.com&quot;&gt;jason.chan@mongodb.com&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=george.wangensteen%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;george.wangensteen@mongodb.com&quot;&gt;george.wangensteen@mongodb.com&lt;/a&gt; about this ticket and what the next steps should be. &lt;/p&gt;</comment>
                            <comment id="4192462" author="suganthi.mani" created="Tue, 16 Nov 2021 17:16:11 +0000"  >&lt;p&gt;There is a possibility of another deadlock as well.&lt;br/&gt;
 1) Tenantmigration oplog applier startup thread:&lt;br/&gt;
 &lt;font color=&quot;#ff0000&quot;&gt;TenantMigrationRecipientService(Mutex)&lt;/font&gt; -&amp;gt; OplogApplier(Mutex) -&amp;gt; OplogBatcher(Mutex) -&amp;gt; &lt;font color=&quot;#ff0000&quot;&gt;primaryOnlyService(Mutex)&lt;/font&gt;(PrimaryOnlyService::registerOpCtx()).&lt;br/&gt;
 2) StepDown thread:&lt;br/&gt;
 RSTL (in X mode) -&amp;gt; &lt;font color=&quot;#ff0000&quot;&gt; primaryOnlyService(Mutex) -&lt;/font&gt;&amp;gt; &lt;font color=&quot;#ff0000&quot;&gt;TenantMigrationRecipientService(Mutex) &lt;/font&gt;(TenantMigrationRecipientService::Instance::interrupt())&lt;/p&gt;

&lt;p&gt;Lock order violation between&#160; primaryOnlyService(Mutex)&#160; and&#160;TenantMigrationRecipientService(Mutex) can cause deadlock.  So, just creating a new opCtx under an instance mutex lock can deadlock with stepdown. And, I believe the same problem exists in other POS services as well.  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=george.wangensteen&quot; class=&quot;user-hover&quot; rel=&quot;george.wangensteen&quot;&gt;george.wangensteen&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2179191">SERVER-71207</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1598094">SERVER-53996</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1537372">SERVER-52723</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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25131"><![CDATA[Serverless]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 26 Oct 2021 22:57:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        48 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_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>didier.nadeau@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            48 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.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>backlog-server-serverless</customfieldvalue>
            <customfieldvalue>didier.nadeau@mongodb.com</customfieldvalue>
            <customfieldvalue>lingzhi.deng@mongodb.com</customfieldvalue>
            <customfieldvalue>steven.vannelli@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|i06ovj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr411i:pi</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="5546">Server Serverless 2021-11-01</customfieldvalue>
    <customfieldvalue id="5553">Server Serverless 2021-11-15</customfieldvalue>
    <customfieldvalue id="5623">Server Serverless 2021-11-29</customfieldvalue>
    <customfieldvalue id="5650">Server Serverless 2021-12-13</customfieldvalue>
    <customfieldvalue id="5669">Server Serverless 2021-12-27</customfieldvalue>
    <customfieldvalue id="5670">Server Serverless 2022-01-10</customfieldvalue>
    <customfieldvalue id="6650">Server Serverless 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|i06b0v:</customfieldvalue>

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