<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:39:37 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-35372] replSetSyncFrom can cause deadlock between ReplicationCoordinator and InitialSyncer</title>
                <link>https://jira.mongodb.org/browse/SERVER-35372</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The InitialSync::_fcvFetcherCallback function &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9aa2a05618d984b1cb23783ab9ebc49b8cfc654a/src/mongo/db/repl/initial_syncer.cpp#L692&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;acquires&lt;/a&gt; the InitialSync mutex and then &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9aa2a05618d984b1cb23783ab9ebc49b8cfc654a/src/mongo/db/repl/initial_syncer.cpp#L767&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;acquires&lt;/a&gt; the ReplicationCoordinator mutex. This ordering is inconsistent with some functions in ReplicationCoordinator e.g. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/3c6d6969752ad4322594dab171ca7dd26b854bc8/src/mongo/db/repl/replication_coordinator_impl.cpp#L2101&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ReplicationCoordinatorImpl::processReplSetSyncFrom&lt;/a&gt; and ReplicationCoordinatorImpl::processReplSetGetStatus. At the time of writing this, the ReplicationCoordinator mutex acquisition was elimiinated in processReplSetGetStatus by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34758&quot; title=&quot;replSetGetStatus can deadlock with initialSyncer&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34758&quot;&gt;&lt;del&gt;SERVER-34758&lt;/del&gt;&lt;/a&gt;. The potential deadlock with processReplSetSyncFrom is mostly addressed already in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28840&quot; title=&quot;replSetSyncFrom causes InitialSyncer and ReplicationCoordinator to acquire each other&amp;#39;s mutexes in opposite orders&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28840&quot;&gt;&lt;del&gt;SERVER-28840&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;-------------------------&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Original Coverity Description&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;Threads may try to acquire two locks in different orders, potentially causing deadlock&lt;/p&gt;

&lt;p&gt;Defect 103597 (STATIC_C)&lt;br/&gt;
  Checker ORDER_REVERSAL (subcategory none)&lt;br/&gt;
  File:  &lt;tt&gt;/src/mongo/db/repl/initial_syncer.cpp&lt;/tt&gt;&lt;br/&gt;
  Function &lt;tt&gt;mongo::repl::InitialSyncer::_fcvFetcherCallback(const mongo::StatusWith&amp;lt;mongo::Fetcher::QueryResponse&amp;gt; &amp;amp;, std::shared_ptr&amp;lt;mongo::repl::CallbackCompletionGuard&amp;lt;mongo::StatusWith&amp;lt;mongo::repl::OpTimeWith&amp;lt;long long&amp;gt;&amp;gt;&amp;gt;&amp;gt;, const mongo::repl::OpTimeWith&amp;lt;long long&amp;gt; &amp;amp;)&lt;/tt&gt;&lt;/p&gt;
</description>
                <environment></environment>
        <key id="553818">SERVER-35372</key>
            <summary>replSetSyncFrom can cause deadlock between ReplicationCoordinator and InitialSyncer</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="13203">Gone away</resolution>
                                        <assignee username="william.schultz@mongodb.com">William Schultz</assignee>
                                    <reporter username="xgen-internal-coverity">Coverity Collector User</reporter>
                        <labels>
                            <label>coverity</label>
                    </labels>
                <created>Mon, 4 Jun 2018 13:11:05 +0000</created>
                <updated>Fri, 27 Oct 2023 20:43:23 +0000</updated>
                            <resolved>Mon, 18 Jun 2018 18:57:58 +0000</resolved>
                                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1923945" author="william.schultz" created="Mon, 18 Jun 2018 18:57:58 +0000"  >&lt;p&gt;Will be fixed by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31487&quot; title=&quot;Replace replSetSyncFrom resync option with initialSyncSource server parameter&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31487&quot;&gt;&lt;del&gt;SERVER-31487&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1923936" author="william.schultz" created="Mon, 18 Jun 2018 18:51:32 +0000"  >&lt;p&gt;Should also be fixed by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31487&quot; title=&quot;Replace replSetSyncFrom resync option with initialSyncSource server parameter&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31487&quot;&gt;&lt;del&gt;SERVER-31487&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1923919" author="william.schultz" created="Mon, 18 Jun 2018 18:43:34 +0000"  >&lt;p&gt;Not going to mark this as a true duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28840&quot; title=&quot;replSetSyncFrom causes InitialSyncer and ReplicationCoordinator to acquire each other&amp;#39;s mutexes in opposite orders&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28840&quot;&gt;&lt;del&gt;SERVER-28840&lt;/del&gt;&lt;/a&gt;, but that ticket describes the same basic issue. The only difference is that the lock acquisition order is in &lt;tt&gt;InitialSyncer::_fcvFetcherCallback&lt;/tt&gt; in this ticket, not &lt;tt&gt;InitialSyncer::_multiApplierCallback&lt;/tt&gt;. &lt;/p&gt;</comment>
                            <comment id="1923706" author="william.schultz" created="Mon, 18 Jun 2018 16:52:57 +0000"  >&lt;p&gt;Claims that &lt;tt&gt;InitialSyncer::_fcvFetcherCallback&lt;/tt&gt; calls &lt;tt&gt;DataReplicatorExternalStateImpl::getCurrentConfig()&lt;/tt&gt; while holding &lt;tt&gt;InitialSyncer::_mutex&lt;/tt&gt;. &lt;tt&gt;DataReplicatorExternalStateImpl::getCurrentConfig()&lt;/tt&gt; will end up calling &lt;tt&gt;ReplicationCoordinatorImpl::getConfig()&lt;/tt&gt; which will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4b544f9059f28ab19fb211ef1f768b24aae5264c/src/mongo/db/repl/replication_coordinator_impl.cpp#L2022&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;take the ReplicationCoordinator mutex&lt;/a&gt;. So the initial syncer will acquire &lt;tt&gt;ReplicationCoodrinator::_mutex&lt;/tt&gt; while holding &lt;tt&gt;InitialSyncer::_mutex&lt;/tt&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="375115">SERVER-28840</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="536717">SERVER-34758</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="443242">SERVER-31487</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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 18 Jun 2018 16:52:57 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 34 weeks, 2 days 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-coverity</customfieldvalue>
            <customfieldvalue>william.schultz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htzp8v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hremm7:</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="2298">Repl 2018-07-02</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|htzbi7:</customfieldvalue>

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