<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:06:12 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-44514] TopologyCoordinator::awaitTopologyChanges returns early on primary topology changes</title>
                <link>https://jira.mongodb.org/browse/SERVER-44514</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;React to state changes when the server is primary prior to state change. Arrange for the isMaster response for all waiters to be constructed once.&lt;/p&gt;

&lt;p&gt;Update isMaster to call the new &lt;tt&gt;ReplicationCoordinatorImpl::getIsMasterResponse&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Write the tests from the design doc for primary state changes.&lt;/p&gt;</description>
                <environment></environment>
        <key id="994299">SERVER-44514</key>
            <summary>TopologyCoordinator::awaitTopologyChanges returns early on primary topology changes</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="jason.chan@mongodb.com">Jason Chan</assignee>
                                    <reporter username="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Nov 2019 19:51:02 +0000</created>
                <updated>Sun, 29 Oct 2023 22:15:10 +0000</updated>
                            <resolved>Wed, 18 Dec 2019 00:28:36 +0000</resolved>
                                                    <fixVersion>4.3.3</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2638992" author="xgen-internal-githook" created="Wed, 18 Dec 2019 00:26:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jason Chan&apos;, &apos;email&apos;: &apos;jason.chan@mongodb.com&apos;, &apos;username&apos;: &apos;jasonjhchan&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44514&quot; title=&quot;TopologyCoordinator::awaitTopologyChanges returns early on primary topology changes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44514&quot;&gt;&lt;del&gt;SERVER-44514&lt;/del&gt;&lt;/a&gt; awaitIsMasterResponse returns early on topology changes&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e83c51c61fa9907459e1cfac9e4bb3517445612f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e83c51c61fa9907459e1cfac9e4bb3517445612f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2597391" author="jason.chan" created="Tue, 10 Dec 2019 19:59:41 +0000"  >&lt;p&gt;The work to fulfill promises after upgrading/downgrading FCV will be tracked through &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45045&quot; title=&quot;Increase topologyVersion and respond to waiting isMasters on FCV upgrade/downgrade&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45045&quot;&gt;&lt;del&gt;SERVER-45045&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2594951" author="jason.chan" created="Mon, 9 Dec 2019 22:09:02 +0000"  >&lt;p&gt;Always fulfilling the promises whenever &lt;tt&gt;_updateMemberStateFromTopologyCoordinator&lt;/tt&gt; is called sounds good to me. I agree with Jesse&apos;s sentiment that the cost of an extra isMaster is low compared to the cost of a possible bug.&lt;/p&gt;</comment>
                            <comment id="2594922" author="tess.avitabile" created="Mon, 9 Dec 2019 21:56:36 +0000"  >&lt;p&gt;Adding promise fulfillment to &lt;tt&gt;_updateMemberStateFromTopologyCoordinator&lt;/tt&gt;&#160;sounds good to me. I think it will be insufficient to check that members are in a new state, since the isMaster response also depends on whether the node can accept writes (see &lt;a href=&quot;https://github.com/mongodb/mongo/blob/01e9fd6d0ec033089ba2f45a440619d3a08c9d9f/src/mongo/db/repl/topology_coordinator.cpp#L1764&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;). This makes me think that we should always fulfill promises in this function, to prevent us from forgetting to fulfill promises if we introduce new topology changes in the future. The risk is that we would fulfill promises spuriously. What do you think?&lt;/p&gt;

&lt;p&gt;As we discussed, we can file a follow-up ticket for handling reconfigs that change horizon mappings. If it doesn&apos;t work to make a decision on slack, I suggest handling this over email.&lt;/p&gt;</comment>
                            <comment id="2594610" author="jason.chan" created="Mon, 9 Dec 2019 19:45:46 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;&lt;br/&gt;
After doing some investigating, I propose adding the logic to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4f00d6e3d7e54a2d131b8216d4b4ef9bfd7a7c6b/src/mongo/db/repl/replication_coordinator_impl.cpp#L2883&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ReplicationCoordinatorImpl::_updateMemberStateFromTopologyCoordinator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This helper is called by the following methods:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4f00d6e3d7e54a2d131b8216d4b4ef9bfd7a7c6b/src/mongo/db/repl/replication_coordinator_impl.cpp#L940&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_setFollowerMode()&lt;/a&gt; for transitions between SECONDARY, RECOVERY, ROLLBACK&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4f00d6e3d7e54a2d131b8216d4b4ef9bfd7a7c6b/src/mongo/db/repl/replication_coordinator_impl.cpp#L1027&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;signalDrainComplete()&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4f00d6e3d7e54a2d131b8216d4b4ef9bfd7a7c6b/src/mongo/db/repl/replication_coordinator_impl.cpp#L2055&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stepDown()&lt;/a&gt; for primary stepdown&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4f00d6e3d7e54a2d131b8216d4b4ef9bfd7a7c6b/src/mongo/db/repl/replication_coordinator_impl.cpp#L2552&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;setMaintenanceMode&lt;/a&gt; for maintenance mode&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4f00d6e3d7e54a2d131b8216d4b4ef9bfd7a7c6b/src/mongo/db/repl/replication_coordinator_impl.cpp#L3325&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_setCurrentRSConfig&lt;/a&gt; for replica set reconfigs&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/be05c9ea62d6f01895545628992f1899426b88c4/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp#L261&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_handleHeartbeatResponseAction_inlock()&lt;/a&gt; for update member state learned from heartbeats.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/be05c9ea62d6f01895545628992f1899426b88c4/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp#L417&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_stepDownFinish()&lt;/a&gt; for stepping down in response to heartbeats.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4f00d6e3d7e54a2d131b8216d4b4ef9bfd7a7c6b/src/mongo/db/repl/replication_coordinator_impl.cpp#L3056&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_postWonElectionUpdateMemberState()&lt;/a&gt; which should account for any stepups that happen.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;We should also update the topology version on upgrading and downgrading FCV as this changes the max/min wireversions.&lt;/p&gt;

&lt;p&gt;Since a lot of these overlap, I think we can add the promise fulfillment logic to the end of _updateMemberStateFromTopologyCoordinator (after checking that members are in a new state) except for the case of Replica set reconfigs. For replica set reconfigs, I believe we have to update the topology version each time since it is possible that the horizons have been updated. &lt;/p&gt;

&lt;p&gt;Question: What should we do for exhaust isMasters after a horizon change? I intended to build a map of waiters per horizon but from what I understand, mappings may change after a replica set reconfig. Should we require clients to re-initiate an exhaust stream after each reconfig or should we implement more logic to deal with these mappings?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="994296">SERVER-44513</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="994286">SERVER-44509</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="994304">SERVER-44515</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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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>Mon, 9 Dec 2019 19:45:46 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 8 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-44509'>SERVER-44509</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-44513'>SERVER-44513</a></s>]]></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-1400</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>
                            4 years, 8 weeks, 1 day ago
                        </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>jason.chan@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hw1bw7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvz16f:</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="3436">Repl 2019-12-02</customfieldvalue>
    <customfieldvalue id="3439">Repl 2020-01-13</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|hw0y5j:</customfieldvalue>

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