<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:40:36 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-56950] Avoid shardRegistry reload infinite loop when overlapping with setFCV</title>
                <link>https://jira.mongodb.org/browse/SERVER-56950</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When &lt;tt&gt;setFCV(v4.4)&lt;/tt&gt; overlaps with a ShardRegistry reload - right after the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e07610ab4e03eab441ede83f8079d49ecc360062/src/mongo/s/client/shard_registry.cpp#L61-L65&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;useActualTopologyTime&lt;/a&gt; check - the ShardRegistry can fall into an infinite loop of lookups because the topology time is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ea2a42d6f59108774e2f5564e4abe8de50f0260c/src/mongo/db/vector_clock.cpp#L329&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;not gossiped&lt;/a&gt; after the setFCV succeeds.&lt;/p&gt;

&lt;p&gt;Purpose of this ticket is to avoid this overlap to result in a livelock.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1715780">SERVER-56950</key>
            <summary>Avoid shardRegistry reload infinite loop when overlapping with setFCV</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="simon.gratzer@mongodb.com">Simon Gratzer</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                            <label>post-rc0</label>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Fri, 14 May 2021 11:52:40 +0000</created>
                <updated>Sun, 29 Oct 2023 21:53:34 +0000</updated>
                            <resolved>Wed, 26 May 2021 14:43:16 +0000</resolved>
                                    <version>5.0.0</version>
                    <version>4.9.0</version>
                                    <fixVersion>5.0.0-rc1</fixVersion>
                    <fixVersion>5.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4108422" author="JIRAUSER1259052" created="Wed, 6 Oct 2021 19:06:53 +0000"  >&lt;p&gt;Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it&#8217;s been triggered. For more active release information, please keep an eye on #server-release. Thank you!&lt;/p&gt;</comment>
                            <comment id="3850400" author="xgen-internal-githook" created="Tue, 1 Jun 2021 07:14:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Simon Gratzer&apos;, &apos;email&apos;: &apos;simon.gratzer@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56950&quot; title=&quot;Avoid shardRegistry reload infinite loop when overlapping with setFCV&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56950&quot;&gt;&lt;del&gt;SERVER-56950&lt;/del&gt;&lt;/a&gt; Avoid shardRegistry reload infinite loop when overlapping with setFCV (BACKPORT-9211)&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/037968db481282012b18b1873c7f72f14b9da48d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/037968db481282012b18b1873c7f72f14b9da48d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3841688" author="xgen-internal-githook" created="Wed, 26 May 2021 14:35:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Simon Gratzer&apos;, &apos;email&apos;: &apos;simon.gratzer@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56950&quot; title=&quot;Avoid shardRegistry reload infinite loop when overlapping with setFCV&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56950&quot;&gt;&lt;del&gt;SERVER-56950&lt;/del&gt;&lt;/a&gt; Avoid shardRegistry reload infinite loop when overlapping with setFCV&lt;/p&gt;

&lt;p&gt;This reverts commit c6ebe28e7ed60bdb8675204144bbb765891a4ca2.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/56143e2127e63e5f949986f4e845dd0ff18a6b92&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/56143e2127e63e5f949986f4e845dd0ff18a6b92&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3826550" author="xgen-internal-githook" created="Tue, 25 May 2021 02:19:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Max Hirschhorn&apos;, &apos;email&apos;: &apos;max.hirschhorn@mongodb.com&apos;, &apos;username&apos;: &apos;visemet&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56950&quot; title=&quot;Avoid shardRegistry reload infinite loop when overlapping with setFCV&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56950&quot;&gt;&lt;del&gt;SERVER-56950&lt;/del&gt;&lt;/a&gt; Avoid shardRegistry reload infinite loop when overlapping with setFCV&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 5ffdb69a0d691549c0d6cd780c2d8be238e588a6.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c6ebe28e7ed60bdb8675204144bbb765891a4ca2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c6ebe28e7ed60bdb8675204144bbb765891a4ca2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3802276" author="xgen-internal-githook" created="Fri, 21 May 2021 08:42:09 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Simon Gratzer&apos;, &apos;email&apos;: &apos;simon.gratzer@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56950&quot; title=&quot;Avoid shardRegistry reload infinite loop when overlapping with setFCV&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56950&quot;&gt;&lt;del&gt;SERVER-56950&lt;/del&gt;&lt;/a&gt; Avoid shardRegistry reload infinite loop when overlapping with setFCV&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5ffdb69a0d691549c0d6cd780c2d8be238e588a6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5ffdb69a0d691549c0d6cd780c2d8be238e588a6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3802130" author="JIRAUSER1259843" created="Fri, 21 May 2021 08:14:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://mongodbcr.appspot.com/778750001/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/778750001/&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">
                                        <issuelink>
            <issuekey id="1720663">SERVER-57017</issuekey>
        </issuelink>
                            </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>6.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="21777"><![CDATA[v5.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>Fri, 21 May 2021 08:14:11 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 18 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_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_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>
                            2 years, 18 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>170.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>pierlauro.sciarelli@mongodb.com</customfieldvalue>
            <customfieldvalue>simon.gratzer@mongodb.com</customfieldvalue>
            <customfieldvalue>vivian.ge@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzarkv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hy39nb:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4840">Sharding EMEA 2021-05-31</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.&#160;&#160;ShardRegistry::_periodicReload causes a reload to occur.&#160;ShardRegistry::_getDataAsync advances the ReadThroughCache&apos;s timeInStore to some t1 with non-zero topologyTime.&#160;ReadThroughCache::acquireAsync creates an inProgressLookup with t1, and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e07610ab4e03eab441ede83f8079d49ecc360062/src/mongo/util/read_through_cache.h#L281&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;add a promise&lt;/a&gt; for it to&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/e07610ab4e03eab441ede83f8079d49ecc360062/src/mongo/util/read_through_cache.h#L635&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;inProgressLookup._outstanding&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;2.&#160;ShardRegistry::_lookup starts running, and meanwhile the test runs setFCV from 4.9 to 4.4.&lt;/p&gt;

&lt;p&gt;3.&#160;ShardRegistryData::createFromCatalogClient returns.&#160;useActualTopologyTime() is false so it &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e07610ab4e03eab441ede83f8079d49ecc360062/src/mongo/s/client/shard_registry.cpp#L149-L155&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;returns the cached data&apos;s topology time&lt;/a&gt; (i.e. Timestamp(0,0) since this is the first reload) as result.t.&#160;&lt;/p&gt;

&lt;p&gt;4. Inside ReadThroughCache::_doLookupWhileNotValid,&#160;inProgressLookup.getPromisesLessThanTime returns nothing because the first promise in _outstanding is the promise for t1 which has non-zero topologyTime (i.e.&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/ea2a42d6f59108774e2f5564e4abe8de50f0260c/src/mongo/s/client/shard_registry.h#L351-L354&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;t1 &amp;gt; result.t&lt;/a&gt;) so the for loop &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e07610ab4e03eab441ede83f8079d49ecc360062/src/mongo/util/read_through_cache.h#L662-L663&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;breaks early here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;5. The promisesToSet is empty so&#160;mustDoAnotherLoop is true. The&#160;_inProgressLookup for t1 remains in the cache, and another round of lookup starts, again no promises can be fulfilled because of 4.&lt;/p&gt;

&lt;p&gt;6. Future reloads &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e07610ab4e03eab441ede83f8079d49ecc360062/src/mongo/util/read_through_cache.h#L270-L271&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;join&lt;/a&gt; this infinitely looping inProgressLookup. (That&apos;s why in the hang analyzer output, there are multiple mongo::ShardRegistry::_periodicReload threads).&lt;/p&gt;</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|hzadtz:</customfieldvalue>

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