<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:44:51 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-80886] $out may fail with a StaleDbVersion after a movePrimary</title>
                <link>https://jira.mongodb.org/browse/SERVER-80886</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If &lt;tt&gt;$out&lt;/tt&gt; runs over a sharded collection after a &lt;tt&gt;movePrimary&lt;/tt&gt; operation, &lt;tt&gt;$out&lt;/tt&gt; will fail constantly with a &lt;tt&gt;StaleDbVersion&lt;/tt&gt; until another operation refreshes the &lt;tt&gt;DbVersion&lt;/tt&gt; on the new primary shard.&lt;/p&gt;

&lt;p&gt;Events sequence leading to the bug:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;shard0&lt;/tt&gt; is the primary shard for &lt;tt&gt;mydb&lt;/tt&gt; database.&lt;/li&gt;
	&lt;li&gt;The sharded collection &lt;tt&gt;mydb.collA&lt;/tt&gt; has chunks on &lt;tt&gt;shard0&lt;/tt&gt; and &lt;tt&gt;shard1&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;A &lt;tt&gt;movePrimary&lt;/tt&gt; for &lt;tt&gt;mydb&lt;/tt&gt; is executed and the new primary is &lt;tt&gt;shard1&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;A &lt;tt&gt;$out&lt;/tt&gt; operation over &lt;tt&gt;mydb.collA&lt;/tt&gt; is launched and is redirected to &lt;tt&gt;shard1&lt;/tt&gt; as the primary of &lt;tt&gt;mydb&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;$out&lt;/tt&gt; executes &lt;tt&gt;listCollection&lt;/tt&gt; command &lt;a href=&quot;https://github.com/10gen/mongo/blob/e3fe147f035b1107797e5ad2496d9f3dabea70fb/src/mongo/db/pipeline/document_source_out.cpp#L213&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; targeting &lt;tt&gt;shard0&lt;/tt&gt; because &lt;tt&gt;shard1&lt;/tt&gt; thinks it&apos;s the primary shard for &lt;tt&gt;mydb&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;The &lt;tt&gt;listCollection&lt;/tt&gt; command fails with &lt;tt&gt;StaleDbVersion&lt;/tt&gt; as expected and &lt;tt&gt;shard1&lt;/tt&gt; forwards the error to the router, so it never refreshes the &lt;tt&gt;DbVersion&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="2437337">SERVER-80886</key>
            <summary>$out may fail with a StaleDbVersion after a movePrimary</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="jordi.serra-torrens@mongodb.com">Jordi Serra Torrens</assignee>
                                    <reporter username="silvia.surroca@mongodb.com">Silvia Surroca</reporter>
                        <labels>
                            <label>shardingemea-qw</label>
                    </labels>
                <created>Fri, 8 Sep 2023 10:31:26 +0000</created>
                <updated>Fri, 29 Dec 2023 16:23:51 +0000</updated>
                            <resolved>Tue, 3 Oct 2023 15:16:12 +0000</resolved>
                                    <version>7.0.1</version>
                    <version>4.4.24</version>
                    <version>6.0.10</version>
                    <version>5.0.21</version>
                    <version>7.1.0-rc2</version>
                                    <fixVersion>7.1.1</fixVersion>
                    <fixVersion>7.2.0-rc0</fixVersion>
                    <fixVersion>7.0.3</fixVersion>
                    <fixVersion>6.0.12</fixVersion>
                    <fixVersion>5.0.24</fixVersion>
                    <fixVersion>4.4.28</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5975329" author="xgen-internal-githook" created="Fri, 29 Dec 2023 15:59:20 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordi.serra-torrens@mongodb.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80886&quot; title=&quot;$out may fail with a StaleDbVersion after a movePrimary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80886&quot;&gt;&lt;del&gt;SERVER-80886&lt;/del&gt;&lt;/a&gt; Wrap ShardServerProcessInterface routing-like code with shardVersionRetry&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 060c42eccc4006a96db28f0b498ce9920e718783)&lt;/p&gt;

&lt;p&gt;GitOrigin-RevId: 1df48bc5aae460ca39c107463f9a3edbcd3e4d20&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b4b3ae12a1566a5141efd59d51f2731baa66dec7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b4b3ae12a1566a5141efd59d51f2731baa66dec7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5975038" author="xgen-internal-githook" created="Fri, 29 Dec 2023 13:18:47 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordist@users.noreply.github.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80886&quot; title=&quot;$out may fail with a StaleDbVersion after a movePrimary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80886&quot;&gt;&lt;del&gt;SERVER-80886&lt;/del&gt;&lt;/a&gt; Wrap ShardServerProcessInterface routing-like code with shardVersionRetry (#17802)&lt;/p&gt;

&lt;p&gt;GitOrigin-RevId: 060c42eccc4006a96db28f0b498ce9920e718783&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2ac17898ea22572ac686ca26b1fc68750ae83a17&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2ac17898ea22572ac686ca26b1fc68750ae83a17&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5790625" author="xgen-internal-githook" created="Thu, 19 Oct 2023 12:58:14 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordi.serra-torrens@mongodb.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80886&quot; title=&quot;$out may fail with a StaleDbVersion after a movePrimary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80886&quot;&gt;&lt;del&gt;SERVER-80886&lt;/del&gt;&lt;/a&gt; Wrap ShardServerProcessInterface routing-like code with DBPrimaryRouter&lt;/p&gt;

&lt;p&gt;(cherry picked from commit fff4dbf400d1f85e47fe84b21c668d4d26570f3a)&lt;br/&gt;
Branch: v6.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e513cd7df412a9d8c2b656ff88035160b1085457&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e513cd7df412a9d8c2b656ff88035160b1085457&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5790300" author="xgen-internal-githook" created="Thu, 19 Oct 2023 11:36:24 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordi.serra-torrens@mongodb.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80886&quot; title=&quot;$out may fail with a StaleDbVersion after a movePrimary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80886&quot;&gt;&lt;del&gt;SERVER-80886&lt;/del&gt;&lt;/a&gt; Wrap ShardServerProcessInterface routing-like code with DBPrimaryRouter&lt;/p&gt;

&lt;p&gt;(cherry picked from commit fff4dbf400d1f85e47fe84b21c668d4d26570f3a)&lt;br/&gt;
Branch: v7.1&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b301df7c32728102a2e42508c1b79fb90f84e1de&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b301df7c32728102a2e42508c1b79fb90f84e1de&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5790291" author="xgen-internal-githook" created="Thu, 19 Oct 2023 11:32:55 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordi.serra-torrens@mongodb.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80886&quot; title=&quot;$out may fail with a StaleDbVersion after a movePrimary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80886&quot;&gt;&lt;del&gt;SERVER-80886&lt;/del&gt;&lt;/a&gt; Wrap ShardServerProcessInterface routing-like code with DBPrimaryRouter&lt;/p&gt;

&lt;p&gt;(cherry picked from commit fff4dbf400d1f85e47fe84b21c668d4d26570f3a)&lt;br/&gt;
Branch: v7.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5445fe8e9237d85a17cb840e8a1c54f8b28a0337&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5445fe8e9237d85a17cb840e8a1c54f8b28a0337&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5748827" author="xgen-internal-githook" created="Tue, 3 Oct 2023 15:02:27 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordi.serra-torrens@mongodb.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-80886&quot; title=&quot;$out may fail with a StaleDbVersion after a movePrimary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-80886&quot;&gt;&lt;del&gt;SERVER-80886&lt;/del&gt;&lt;/a&gt; Wrap ShardServerProcessInterface routing-like code with DBPrimaryRouter&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/fff4dbf400d1f85e47fe84b21c668d4d26570f3a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/fff4dbf400d1f85e47fe84b21c668d4d26570f3a&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </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>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25133"><![CDATA[Sharding EMEA]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26243"><![CDATA[v7.1]]></customfieldvalue>
    <customfieldvalue key="25578"><![CDATA[v7.0]]></customfieldvalue>
    <customfieldvalue key="23470"><![CDATA[v6.0]]></customfieldvalue>
    <customfieldvalue key="21777"><![CDATA[v5.0]]></customfieldvalue>
    <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_23577" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>CAR Impact</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25717"><![CDATA[4 Data loss/Availability]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 3 Oct 2023 13:28:14 +0000</customfieldvalue>

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


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 weeks, 5 days ago
                        </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>jordi.serra-torrens@mongodb.com</customfieldvalue>
            <customfieldvalue>silvia.surroca@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2ppif:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i27osw:</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="7719">Sharding EMEA 2023-10-02</customfieldvalue>
    <customfieldvalue id="7720">Sharding EMEA 2023-10-16</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</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|i2pbnr:</customfieldvalue>

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