<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:34:31 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-33766] Secondary may not invalidate in-memory routing table cache after primary refresh</title>
                <link>https://jira.mongodb.org/browse/SERVER-33766</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Secondaries &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1441f6000823f3889d0f7f90fe3f3f6b67fed0ac/src/mongo/db/s/shard_server_op_observer.cpp#L271-L274&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;have an OpObserver on &quot;config.cache.collections&quot;&lt;/a&gt;  to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1441f6000823f3889d0f7f90fe3f3f6b67fed0ac/src/mongo/db/s/shard_server_op_observer.cpp#L80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;invalidate their in-memory routing table cache entry&lt;/a&gt; for the namespace whose routing table is being updated, if the oplog entry has field &apos;lastRefreshedCollectionVersion&apos;.&lt;/p&gt;

&lt;p&gt;Primaries &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1441f6000823f3889d0f7f90fe3f3f6b67fed0ac/src/mongo/db/s/shard_metadata_util.cpp#L102-L103&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;write the &apos;lastRefreshedCollectionVersion&apos; field&lt;/a&gt; when marking the config.cache.collections entry as done refreshing. However, they &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1441f6000823f3889d0f7f90fe3f3f6b67fed0ac/src/mongo/db/s/shard_metadata_util.cpp#L102-L103&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;only write the major/minor versions&lt;/a&gt; of the collection version; that is, they do not include the epoch.&lt;/p&gt;

&lt;p&gt;If a sharded collection exists with one chunk (e.g., collectionVersion=(1,0, epoch)), then is dropped, recreated, and re-sharded, but the best-effort setShardVersion for the drop fails, then the refresh after the shardCollection will persist lastRefreshedCollectionVersion=(1,0).&lt;/p&gt;

&lt;p&gt;Since this is no different than the lastRefreshedCollectionVersion already in the config.cache.collections document, the oplog entry for this update will not include the &apos;lastRefreshedCollectionVersion&apos; field, so the OpObserver on the secondary will not fire.&lt;/p&gt;

&lt;p&gt;Also &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dianna.hohensee&quot; class=&quot;user-hover&quot; rel=&quot;dianna.hohensee&quot;&gt;dianna.hohensee&lt;/a&gt;, shouldn&apos;t the primary write &apos;lastRefreshedCollectionVersion&apos; when &lt;b&gt;starting&lt;/b&gt; the refresh, so that the secondary invalidates its in-memory cache sooner?&lt;/p&gt;</description>
                <environment></environment>
        <key id="508155">SERVER-33766</key>
            <summary>Secondary may not invalidate in-memory routing table cache after primary refresh</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="esha.maharishi@mongodb.com">Esha Maharishi</reporter>
                        <labels>
                            <label>ShardingTechDebt</label>
                    </labels>
                <created>Thu, 8 Mar 2018 22:25:14 +0000</created>
                <updated>Sun, 29 Oct 2023 22:33:58 +0000</updated>
                            <resolved>Fri, 20 Apr 2018 22:03:43 +0000</resolved>
                                    <version>3.6.3</version>
                    <version>3.7.2</version>
                                    <fixVersion>3.6.5</fixVersion>
                    <fixVersion>3.7.6</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1871780" author="xgen-internal-githook" created="Mon, 23 Apr 2018 19:04:07 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;golden.janna@gmail.com&apos;, &apos;username&apos;: &apos;jannaerin&apos;, &apos;name&apos;: &apos;jannaerin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33766&quot; title=&quot;Secondary may not invalidate in-memory routing table cache after primary refresh&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33766&quot;&gt;&lt;del&gt;SERVER-33766&lt;/del&gt;&lt;/a&gt; Ensure secondaries always invalidate their in-memory routing table when new metadata arrives&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9bcf96d7c37bde286dd0602053d97d7a20f28bff&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9bcf96d7c37bde286dd0602053d97d7a20f28bff&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1870726" author="xgen-internal-githook" created="Sat, 21 Apr 2018 00:51:36 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;golden.janna@gmail.com&apos;, &apos;username&apos;: &apos;jannaerin&apos;, &apos;name&apos;: &apos;jannaerin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33766&quot; title=&quot;Secondary may not invalidate in-memory routing table cache after primary refresh&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33766&quot;&gt;&lt;del&gt;SERVER-33766&lt;/del&gt;&lt;/a&gt; Ensure that secondaries always invalidate the in-memory routing table when new&lt;br/&gt;
metadata arrives&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b48579fcba7dfe3c7178b60c88feec96955c02f7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b48579fcba7dfe3c7178b60c88feec96955c02f7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1870649" author="xgen-internal-githook" created="Fri, 20 Apr 2018 22:02:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;golden.janna@gmail.com&apos;, &apos;username&apos;: &apos;jannaerin&apos;, &apos;name&apos;: &apos;jannaerin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33766&quot; title=&quot;Secondary may not invalidate in-memory routing table cache after primary refresh&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33766&quot;&gt;&lt;del&gt;SERVER-33766&lt;/del&gt;&lt;/a&gt; Ensure that secondaries always invalidate the in-memory routing table when new&lt;br/&gt;
metadata arrives&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a458c159eb3d3bf5260bbde38eeed22a45586636&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a458c159eb3d3bf5260bbde38eeed22a45586636&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1828319" author="dianna.hohensee" created="Fri, 9 Mar 2018 02:43:07 +0000"  >&lt;p&gt;Technically, config.cache.collections already has the epoch field, but the OpObserver isn&apos;t looking at it.&lt;/p&gt;

&lt;p&gt;However,&lt;br/&gt;
1) We&apos;re going to remove the epoch field someday soon, since we have a UUID field in there, too.&lt;br/&gt;
2) You&apos;re suggesting that we now watch 3 fields, rather than 2 or even just 1, for a simple stable / not stable question. You&apos;ll frankly make me cry if it gets so over-complicated &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
3) There isn&apos;t a reason to be using a ChunkVersion. I added &apos;lastRefreshedCollectionVersion&apos;, rather than a sequence number, because it was thought that a version would be more useful for some undefined diagnostic purpose. But that never eventuated: we don&apos;t use it for logging anywhere, nor have we ever wanted to consult it for system diagnosis. You could technically merge &apos;refreshing&apos; and &apos;refreshSequenceNumber&apos; into one value and be just fine.&lt;/p&gt;

&lt;p&gt;You&apos;re going to have to deal with backwards compatibility, by the way. I hesitate to say this, but the simplest fix would indeed be to start watching the &apos;epoch&apos; field for changes. Backport it, and you&apos;re done without backwards compatibility issues. That&apos;s probably the v3.6 fix regardless.&lt;/p&gt;</comment>
                            <comment id="1828163" author="esha.maharishi@10gen.com" created="Thu, 8 Mar 2018 23:04:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dianna.hohensee&quot; class=&quot;user-hover&quot; rel=&quot;dianna.hohensee&quot;&gt;dianna.hohensee&lt;/a&gt;, wouldn&apos;t it also work to just write the entire ChunkVersion (including epoch), rather than only writing the major/minor versions?&lt;/p&gt;</comment>
                            <comment id="1828159" author="dianna.hohensee" created="Thu, 8 Mar 2018 23:01:33 +0000"  >&lt;p&gt;A solution for this ticket would be to go back to the original implementation/design proposal, where instead of &apos;lastRefreshedCollectionVersion&apos; and Timestamp, we had &apos;refreshSequenceNumber&apos; as an int we alway incremented.&lt;/p&gt;

&lt;p&gt;Here&apos;s the commit that changed it from &apos;lastRefreshedCollectionVersion&apos; to &apos;refreshSequenceNumber&apos; &lt;a href=&quot;https://github.com/mongodb/mongo/commit/125497e1ba8b4cd10ae5fa84fc66e70cfe46ccce#diff-de22a7651073aa247f338651b950a06c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/125497e1ba8b4cd10ae5fa84fc66e70cfe46ccce#diff-de22a7651073aa247f338651b950a06c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1828143" author="dianna.hohensee" created="Thu, 8 Mar 2018 22:50:24 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt;, there&apos;s no point in invalidating the routing table before the updates fully propagate, because there&apos;s already a window of time before anything replicates where secondaries will continue to service requests: replication lag. If the secondary decides to refresh from the persisted routing table, it will see &apos;refreshing&apos; and wait for a stable view. Seeing &apos;lastRefreshedCollectionVersion&apos; will cause the secondary OpObserver to wake up any threads waiting to load the persisted routing table &amp;#8211; threads waiting because they saw &apos;refreshing&apos; true.&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>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15141"><![CDATA[v3.6]]></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>Thu, 8 Mar 2018 22:50:24 +0000</customfieldvalue>

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


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 42 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>25.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>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <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|hts4hb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8zsf:</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="2217">Sharding 2018-04-23</customfieldvalue>
    <customfieldvalue id="2257">Sharding 2018-05-07</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|htrqnz:</customfieldvalue>

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