<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:45:28 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-37255] replSetReconfig with concurrent election can trigger invariant</title>
                <link>https://jira.mongodb.org/browse/SERVER-37255</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If a &lt;tt&gt;replSetReconfig&lt;/tt&gt; runs on a node that is concurrently processing a successful election win, it is possible to trigger &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c46faf4672c81d4801014981669d770fc65b950e/src/mongo/db/repl/replication_coordinator_impl.cpp#L3547&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this invariant&lt;/a&gt;. The &lt;tt&gt;ReplicationCoordinatorImpl::_onVoteRequestComplete&lt;/tt&gt; method is called when the VoteRequester completes. In the case of a successful election, we will print &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b19e39088cf8754186de8f5f3f1dae17a12aaa4c/src/mongo/db/repl/replication_coordinator_impl_elect_v1.cpp#L314&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this message&lt;/a&gt;, and then proceed to processing the election win. We will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b19e39088cf8754186de8f5f3f1dae17a12aaa4c/src/mongo/db/repl/replication_coordinator_impl_elect_v1.cpp#L327&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;reset the VoteRequester&lt;/a&gt; and then &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b19e39088cf8754186de8f5f3f1dae17a12aaa4c/src/mongo/db/repl/replication_coordinator_impl_elect_v1.cpp#L331&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;update our member state&lt;/a&gt; to reflect our transition to leader. Before we call &lt;tt&gt;_performPostMemberStateUpdateAction&lt;/tt&gt;, though, we unlock the ReplicationCoordinator mutex. This allows a concurrent reconfig command, currently running &lt;tt&gt;ReplicationCoordinatorImpl::_finishReplSetReconfig&lt;/tt&gt;, to end up  &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c46faf4672c81d4801014981669d770fc65b950e/src/mongo/db/repl/replication_coordinator_impl.cpp#L2361&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;cancelling an election&lt;/a&gt; before we have transitioned to &lt;tt&gt;Leader&lt;/tt&gt; mode. We call &lt;tt&gt;ReplicationCoordinatorImpl::_cancelElectionIfNeeded_inlock&lt;/tt&gt; when the &lt;tt&gt;_voteRequester&lt;/tt&gt; has been reset, but while we are still in the &lt;tt&gt;Candidate&lt;/tt&gt; role. So, we will not return early &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c46faf4672c81d4801014981669d770fc65b950e/src/mongo/db/repl/replication_coordinator_impl.cpp#L3544-L3546&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;, and will end up hitting the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c46faf4672c81d4801014981669d770fc65b950e/src/mongo/db/repl/replication_coordinator_impl.cpp#L3547&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;subsequent invariant&lt;/a&gt;, since the VoteRequester was already destroyed.&lt;/p&gt;</description>
                <environment></environment>
        <key id="608120">SERVER-37255</key>
            <summary>replSetReconfig with concurrent election can trigger invariant</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="william.schultz@mongodb.com">William Schultz</reporter>
                        <labels>
                            <label>SWNA</label>
                    </labels>
                <created>Fri, 21 Sep 2018 16:15:54 +0000</created>
                <updated>Sun, 29 Oct 2023 22:28:00 +0000</updated>
                            <resolved>Tue, 8 Jan 2019 00:02:24 +0000</resolved>
                                    <version>3.6.11</version>
                    <version>4.0.7</version>
                    <version>4.1.6</version>
                                    <fixVersion>3.6.12</fixVersion>
                    <fixVersion>4.0.8</fixVersion>
                    <fixVersion>4.1.7</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="2189347" author="xgen-internal-githook" created="Fri, 22 Mar 2019 21:46:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37255&quot; title=&quot;replSetReconfig with concurrent election can trigger invariant&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37255&quot;&gt;&lt;del&gt;SERVER-37255&lt;/del&gt;&lt;/a&gt; Fix invariant when reconfig races with election&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d370aed86df0489e8ff7ee308f4faefa54b57c05&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d370aed86df0489e8ff7ee308f4faefa54b57c05&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2187980" author="xgen-internal-githook" created="Thu, 21 Mar 2019 20:51:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37255&quot; title=&quot;replSetReconfig with concurrent election can trigger invariant&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37255&quot;&gt;&lt;del&gt;SERVER-37255&lt;/del&gt;&lt;/a&gt; Fix invariant when reconfig races with election&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a1c7c798168f13284a486153dde4b335735cea0a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a1c7c798168f13284a486153dde4b335735cea0a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2160049" author="jesse" created="Fri, 22 Feb 2019 18:17:46 +0000"  >&lt;p&gt;Requesting backport: a build failure was found on 4.0.6 due to this invariant.&lt;/p&gt;</comment>
                            <comment id="2108114" author="xgen-internal-githook" created="Tue, 8 Jan 2019 00:02:04 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;ajdavis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37255&quot; title=&quot;replSetReconfig with concurrent election can trigger invariant&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37255&quot;&gt;&lt;del&gt;SERVER-37255&lt;/del&gt;&lt;/a&gt; Fix invariant when reconfig races with election&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/327a6bd87961eb7d3cd2a4cd90170e868adf2112&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/327a6bd87961eb7d3cd2a4cd90170e868adf2112&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2010640" author="william.schultz" created="Fri, 21 Sep 2018 17:03:55 +0000"  >&lt;p&gt;A general solution would ideally address the atomicity issues caused by the fact the &lt;tt&gt;ReplicationCoordinatorImpl::_performPostMemberStateUpdateAction&lt;/tt&gt; method must be called without the ReplicationCoordinator mutex. When we want to update internal repl state with that method, we re-acquire the lock after calling the method, but this seems naturally prone to race conditions. Ideally, the mutex wouldn&apos;t need to be released and re-acquired if we are only updating internal repl state from inside _performPostMemberStateUpdateAction i.e. not calling into ReplicationCoordinatorExternalState. Perhaps we could split this method into two i.e. one that explicitly updates internal state and requires the mutex, and one that updates external state, and does not.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </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>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    <customfieldvalue key="15141"><![CDATA[v3.6]]></customfieldvalue>
    <customfieldvalue key="14340"><![CDATA[v3.4]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 17 Dec 2018 19:32:43 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 46 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_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>
                            4 years, 46 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>52.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>jesse@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</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|hu8kfj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu5l53:</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="2542">Repl 2018-10-22</customfieldvalue>
    <customfieldvalue id="2543">Repl 2018-11-05</customfieldvalue>
    <customfieldvalue id="2701">Repl 2019-01-14</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|hu86ov:</customfieldvalue>

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