<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:17:19 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-48504] Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash</title>
                <link>https://jira.mongodb.org/browse/SERVER-48504</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If a StaleShardVersion is encountered while running a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/batch_write_exec.cpp#L119&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BatchWriteExec::executeBatch&lt;/a&gt;, we will call &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L597&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ChunkManagerTargeter::noteStaleShardResponse&lt;/a&gt; that &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L613&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;will populate the _remoteShardVersions map&#160;&lt;/a&gt; with the stale error info.&lt;br/&gt;
 Then a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/batch_write_exec.cpp#L429&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;refresh of the targeter is attempted&lt;/a&gt; that will trigger &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L800&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;a refresh of the routingInfo&lt;/a&gt; , this can throw a ShardNotFound exception (&lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/batch_write_exec.cpp#L434-L440&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;catched here&lt;/a&gt;). At this point we will loop again in the executeBatch function and we will call &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/batch_write_exec.cpp#L176&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ChunkManagerTargeter::noteCouldNotTarget&lt;/a&gt;, now since the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L613&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_remoteShardVersions&lt;/a&gt; map is not empty we will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L592&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;hit this dassert.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The bug has been triggered by the jstests/concurrency/fsm_workloads_add_remove_shards/clusterwide_ops_with_add_drop_shards.js test that is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/jstests/concurrency/fsm_workloads_add_remove_shards/clusterwide_ops_with_add_drop_shards.js#L27&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;manually dropping&lt;/a&gt; the `config.shards` collection of the mongos causing the ShardNotFound error. It is only happening in the Enterprise RHEL 6.2 DEBUG Code Coverage and the&lt;/p&gt;


{UB}
&lt;p&gt;SAN Enterprise Ubuntu 18.04 DEBUG both in 4.4 and in master.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1366883">SERVER-48504</key>
            <summary>Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash</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="tommaso.tocci@mongodb.com">Tommaso Tocci</assignee>
                                    <reporter username="tommaso.tocci@mongodb.com">Tommaso Tocci</reporter>
                        <labels>
                            <label>non-blocking</label>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Fri, 29 May 2020 18:25:22 +0000</created>
                <updated>Sun, 29 Oct 2023 22:07:36 +0000</updated>
                            <resolved>Thu, 30 Jul 2020 11:42:20 +0000</resolved>
                                    <version>4.4.0-rc7</version>
                                    <fixVersion>4.7.0</fixVersion>
                    <fixVersion>4.4.2</fixVersion>
                    <fixVersion>4.2.18</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4197092" author="xgen-internal-githook" created="Thu, 18 Nov 2021 10:04:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Tommaso Tocci&apos;, &apos;email&apos;: &apos;tommaso.tocci@mongodb.com&apos;, &apos;username&apos;: &apos;toto-dev&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48504&quot; title=&quot;Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48504&quot;&gt;&lt;del&gt;SERVER-48504&lt;/del&gt;&lt;/a&gt; Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4105bd383b018a7b3e1835767cde75584e5e0bae&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4105bd383b018a7b3e1835767cde75584e5e0bae&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3381667" author="xgen-internal-githook" created="Wed, 9 Sep 2020 10:18:04 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Tommaso Tocci&apos;, &apos;email&apos;: &apos;tommaso.tocci@mongodb.com&apos;, &apos;username&apos;: &apos;toto-dev&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48504&quot; title=&quot;Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48504&quot;&gt;&lt;del&gt;SERVER-48504&lt;/del&gt;&lt;/a&gt; Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3925fa9d2b8c00eca3c63acd442ed4ee0eae2b07)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bb917c502bd71702a71057f9bf7237207cbac4ff&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bb917c502bd71702a71057f9bf7237207cbac4ff&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3381552" author="tommaso.tocci" created="Wed, 9 Sep 2020 08:19:30 +0000"  >&lt;p&gt;EVG: &lt;a href=&quot;https://evergreen.mongodb.com/version/5f588fee56234342068eeb20&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://evergreen.mongodb.com/version/5f588fee56234342068eeb20&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3313515" author="xgen-internal-githook" created="Thu, 30 Jul 2020 11:34:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Tommaso Tocci&apos;, &apos;email&apos;: &apos;tommaso.tocci@mongodb.com&apos;, &apos;username&apos;: &apos;toto-dev&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48504&quot; title=&quot;Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48504&quot;&gt;&lt;del&gt;SERVER-48504&lt;/del&gt;&lt;/a&gt; Combination of StaleShardVersion and ShardNotFound exception make the ChunkManagerTargeter crash&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3925fa9d2b8c00eca3c63acd442ed4ee0eae2b07&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3925fa9d2b8c00eca3c63acd442ed4ee0eae2b07&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>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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>
    <customfieldvalue key="16775"><![CDATA[v4.2]]></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 Jul 2020 03:41:22 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 11 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_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, 11 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>20.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>tommaso.tocci@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxnqof:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxaxx3:</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="3954">Sharding 2020-07-13</customfieldvalue>
    <customfieldvalue id="4135">Sharding 2020-07-27</customfieldvalue>
    <customfieldvalue id="4136">Sharding 2020-08-10</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;The bug has been triggered by the jstests/concurrency/fsm_workloads_add_remove_shards/clusterwide_ops_with_add_drop_shards.js test that is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ca388ac2c93d785260aafdcc05299e0a7c3a41c0/jstests/concurrency/fsm_workloads_add_remove_shards/clusterwide_ops_with_add_drop_shards.js#L27&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;manually dropping&lt;/a&gt; the `config.shards` collection of the mongos causing the ShardNotFound error.&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|hxncxr:</customfieldvalue>

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