<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:01: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-42746] Investigate if batch writer behaves correctly when we fail because we could not target for an unsharded collection</title>
                <link>https://jira.mongodb.org/browse/SERVER-42746</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It is possible that mongos was &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/batch_write_exec.cpp#L162-L164&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;not able&lt;/a&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/batch_write_op.cpp#L322&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;to target&lt;/a&gt; a write batch on a collection that mongos&apos;s cache says is unsharded. Such an error should only come from &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/write_op.cpp#L58-L72&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this block&lt;/a&gt;, since the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/write_op.cpp#L81-L86&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;other place an error can come from&lt;/a&gt; should only occur if mongos targeted &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/write_op.cpp#L80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;more than one shard&lt;/a&gt;. At first glance, it seems that the only error &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L394-L397&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;targetInsert&lt;/a&gt;, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L429-L433&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;targetUpdate&lt;/a&gt;, and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L583-L&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;targetDelete&lt;/a&gt; (through &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L583-L-L587&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_targetQuery&lt;/a&gt;) can return if mongos&apos;s cache says the collection is unsharded is NamespaceNotFound. If that is returned, the targeter&apos;s _needsTargetingRefresh &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/batch_write_exec.cpp#L164&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;will be&lt;/a&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L672&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set to true&lt;/a&gt;. Then when &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/batch_write_exec.cpp#L425&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;targeter.refreshIfNeeded is called&lt;/a&gt;, it will take &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6db227bc5616d6af031a797d87eaad193c8c32f0/src/mongo/s/write_ops/chunk_manager_targeter.cpp#L769-L783&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this branch&lt;/a&gt;. I want to know:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Is NamespaceNotFound really the only error expected when targeting an unsharded collection?&lt;/li&gt;
	&lt;li&gt;If so, does that branch handle NamespaceNotFound in a sane way?&lt;/li&gt;
	&lt;li&gt;If not, should that branch be calling _refreshDbVersionNow?&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="889952">SERVER-42746</key>
            <summary>Investigate if batch writer behaves correctly when we fail because we could not target for an unsharded collection</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="cheahuychou.mao@mongodb.com">Cheahuychou Mao</assignee>
                                    <reporter username="janna.golden@mongodb.com">Janna Golden</reporter>
                        <labels>
                    </labels>
                <created>Fri, 9 Aug 2019 18:32:05 +0000</created>
                <updated>Tue, 1 Oct 2019 00:05:08 +0000</updated>
                            <resolved>Fri, 27 Sep 2019 21:04:22 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                        <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 27 Sep 2019 21:02:58 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 26 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1051</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>esha.maharishi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 26 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>cheahuychou.mao@mongodb.com</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|hvjyev:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hthdlb:</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="3305">Sharding 2019-10-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|hvjko7:</customfieldvalue>

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