<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:13:57 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-47359] ShardRegistry reload can race with RSM updates to ShardRegistry</title>
                <link>https://jira.mongodb.org/browse/SERVER-47359</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;During startup, the ShardRegistry stores all nodes in the initial config server string and then schedules its initial reload and the RSM begins to monitor the config server. During start up, if the RSM gets a topology change of type ReplicaSetNoPrimary, (meaning its only heard back from secondaries), it will update the ShardRegistry with this info and remove any nodes that are not yet confirmed. The following set of steps can lead to a ShardNotFound error:&lt;/p&gt;

&lt;p&gt;1. ShardRegistry starts up with all config server nodes passed in the initial connection string. &lt;br/&gt;
2. RSM starts up and begins monitoring the config server.&lt;br/&gt;
3. RSM hears back from a secondary node (let&apos;s say node 1), the TopologyChangeEvent can look something like &lt;span class=&quot;error&quot;&gt;&amp;#91;node 0: type unknown, node 1: type secondary, node 2: type unknown&amp;#93;&lt;/span&gt;. The RSM &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a8f80d013ee948e04671b1814d9f3989f6ea8314/src/mongo/client/streamable_replica_set_monitor.cpp#L565&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;notifies the ShardRegistry&lt;/a&gt; with this info. This will cause the ShardRegistry to remove node 0 and node 2 from the ShardRegistryData object `_data` owned by the ShardRegistry. (Specifically it removes hosts from the ShardRegistryData&apos;s `_hostLookup` and `_lookup` maps &lt;a href=&quot;https://github.com/mongodb/mongo/blob/177d55adfd397de4b78f35a2da0bdd9160c623c7/src/mongo/s/client/shard_registry.cpp#L607-L611&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;)&lt;br/&gt;
4. ShardRegistry&apos;s initial refresh starts. It &lt;a href=&quot;https://github.com/mongodb/mongo/blob/177d55adfd397de4b78f35a2da0bdd9160c623c7/src/mongo/s/client/shard_registry.cpp#L339&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;constructs a new ShardRegsitryData object&lt;/a&gt; which at this moment only has node 1 for the config server.&lt;br/&gt;
5. RSM gets a TopologyChangeEvent from the primary which can look something like &lt;span class=&quot;error&quot;&gt;&amp;#91;node 0: type primary, node 1: type secondary, node 2: type secondary&amp;#93;&lt;/span&gt;. The RSM now thinks each of these nodes is able to be targeted. It &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a8f80d013ee948e04671b1814d9f3989f6ea8314/src/mongo/client/streamable_replica_set_monitor.cpp#L542-L545&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sends an update to the ShardRegistry&lt;/a&gt; with this info.&lt;br/&gt;
6. The &lt;a href=&quot;https://github.com/mongodb/mongo/blob/177d55adfd397de4b78f35a2da0bdd9160c623c7/src/mongo/s/client/shard_registry.cpp#L206&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardRegistry adds each of the nodes&lt;/a&gt; the RSM notified it about to the `_data` object.&lt;br/&gt;
7. The ShardRegistry reload &lt;a href=&quot;https://github.com/mongodb/mongo/blob/177d55adfd397de4b78f35a2da0bdd9160c623c7/src/mongo/s/client/shard_registry.cpp#L341&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;swaps out it&apos;s `_data` object that was just updated in step 6 with the ShardRegistryData object in constructed in step 4&lt;/a&gt;.&lt;br/&gt;
8. The RSM thinks node 0 is able to be targeted, so returns it to some command to target. The ShardingNetworkConnectionHook then tries to target node 0 and grab it from the ShardRegistry, but it does not exist anymore so &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2ad12521309aeccc6f712f4ccb532f113255d186/src/mongo/s/client/sharding_network_connection_hook.cpp#L57-L62&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;throws ShardNotFound&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1305984">SERVER-47359</key>
            <summary>ShardRegistry reload can race with RSM updates to ShardRegistry</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="janna.golden@mongodb.com">Janna Golden</assignee>
                                    <reporter username="janna.golden@mongodb.com">Janna Golden</reporter>
                        <labels>
                            <label>KP44</label>
                    </labels>
                <created>Mon, 6 Apr 2020 18:46:20 +0000</created>
                <updated>Sun, 29 Oct 2023 22:09:52 +0000</updated>
                            <resolved>Wed, 15 Apr 2020 02:25:52 +0000</resolved>
                                                    <fixVersion>4.4.0-rc2</fixVersion>
                    <fixVersion>4.7.0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3043424" author="xgen-internal-githook" created="Thu, 16 Apr 2020 21:25:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;jannaerin&apos;, &apos;email&apos;: &apos;golden.janna@gmail.com&apos;, &apos;username&apos;: &apos;jannaerin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47359&quot; title=&quot;ShardRegistry reload can race with RSM updates to ShardRegistry&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47359&quot;&gt;&lt;del&gt;SERVER-47359&lt;/del&gt;&lt;/a&gt; ShardRegistry reload can race with RSM updates to ShardRegistry&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 2ecb450c1a48775953160b50ae0ac6e9f0ae5723)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3ef8b9d849ce65cf1deb9f37d9d3b1a2741864b9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3ef8b9d849ce65cf1deb9f37d9d3b1a2741864b9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3040046" author="xgen-internal-githook" created="Wed, 15 Apr 2020 02:24:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;jannaerin&apos;, &apos;email&apos;: &apos;golden.janna@gmail.com&apos;, &apos;username&apos;: &apos;jannaerin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47359&quot; title=&quot;ShardRegistry reload can race with RSM updates to ShardRegistry&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47359&quot;&gt;&lt;del&gt;SERVER-47359&lt;/del&gt;&lt;/a&gt; ShardRegistry reload can race with RSM updates to ShardRegistry&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2ecb450c1a48775953160b50ae0ac6e9f0ae5723&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2ecb450c1a48775953160b50ae0ac6e9f0ae5723&lt;/a&gt;&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>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></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>Wed, 15 Apr 2020 02:24:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 42 weeks, 6 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-1519</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>
                            3 years, 42 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>115.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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>janna.golden@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxds3b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hwyanr:</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="3837">Sharding 2020-04-20</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|hxdecn:</customfieldvalue>

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