<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:32:57 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-76541] documents can&apos;t be find with secondary readPref from mongos after create an sharded collection </title>
                <link>https://jira.mongodb.org/browse/SERVER-76541</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;After creating a sharded collection and inserting some documents, thoese documents&#160; may not be read from other mongos with secondary readPref&#65292; even by setting local readConcern.&lt;/p&gt;

&lt;p&gt;Another mongos thinks that the table is a unsharded unshared collection and sends the request to the primaryshard, but the data may be distributed on another shard.&lt;/p&gt;

&lt;p&gt;And if secondary readpref is set, the request sent to the shard will not carry routing information, and will not check whether the route is dirty, so the route cannot be refreshed.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.4.13/src/mongo/db/service_entry_point_common.cpp#L1157&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/r4.4.13/src/mongo/db/service_entry_point_common.cpp#L1157&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/r4.4.13/src/mongo/db/s/collection_sharding_runtime.cpp#L328&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/r4.4.13/src/mongo/db/s/collection_sharding_runtime.cpp#L328&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;With local readconcern, this phenomenon still exists.&lt;/p&gt;

&lt;p&gt;Although the routing information is carried, the routing is empty and can pass the inspection.&lt;/p&gt;

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

&lt;p&gt;5.0 does not have this problem, it seems that because the code of the route cache is modified, mongos will refresh the route after receiving the first request.&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="2324540">SERVER-76541</key>
            <summary>documents can&apos;t be find with secondary readPref from mongos after create an sharded collection </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="3">Duplicate</resolution>
                                        <assignee username="yuan.fang@mongodb.com">Yuan Fang</assignee>
                                    <reporter username="1321280378feng@gmail.com">Chao Yin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Apr 2023 11:23:43 +0000</created>
                <updated>Wed, 26 Apr 2023 14:22:40 +0000</updated>
                            <resolved>Wed, 26 Apr 2023 14:22:28 +0000</resolved>
                                    <version>4.4 Required</version>
                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5377572" author="JIRAUSER1270794" created="Wed, 26 Apr 2023 14:21:30 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=1321280378feng%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;1321280378feng@gmail.com&quot;&gt;1321280378feng@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for submitting your report. It appears that the issue you reported is a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53474&quot; title=&quot;Cannot read from another mongos with secondaryPreferred after creating a new collection on one mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53474&quot;&gt;&lt;del&gt;SERVER-53474&lt;/del&gt;&lt;/a&gt; and the root cause seems to be &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32198&quot; title=&quot;Missing collection metadata on the shard implies both UNSHARDED and &amp;quot;metadata not loaded yet&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32198&quot;&gt;&lt;del&gt;SERVER-32198&lt;/del&gt;&lt;/a&gt;, which has been fixed in version 4.7.&lt;/p&gt;

&lt;p&gt;I am closing this ticket for now. However, if you see any evidence indicating this is a separate issue, please let us know and we will reopen the ticket.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Yuan&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1575975">SERVER-53474</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1628165">SERVER-54625</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</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>Wed, 26 Apr 2023 14:21:30 +0000</customfieldvalue>

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


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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            41 weeks 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>1321280378feng@gmail.com</customfieldvalue>
            <customfieldvalue>yuan.fang@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i26een:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1op8w:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;ol&gt;
	&lt;li&gt;Prepare a sharded mongodb4.4 cluster with two mongos and two shards&lt;/li&gt;
	&lt;li&gt;&#160;Login mongosA,&lt;/li&gt;
	&lt;li&gt;&#160;sh.enableSharding(&quot;yc&quot;); &#160;sh.shardCollection(&quot;yc.coll1&quot;, {a:&quot;hashed&quot;});&lt;/li&gt;
	&lt;li&gt;insert some data; db.coll1.insert({a:1} ;db.coll1.insert({a:2} ;db.coll1.insert({a:3} ;&lt;/li&gt;
	&lt;li&gt;&#160;login mongosB,&lt;/li&gt;
	&lt;li&gt;run find command to flush route of&#160; &apos;yc&apos; db.&lt;/li&gt;
	&lt;li&gt;use yc; db.coll1.find({a:1}); db.coll1.find({a:2}); db.coll1.find({a:3});&#160;&lt;/li&gt;
	&lt;li&gt;Login mongosA, shard another collection&lt;/li&gt;
	&lt;li&gt;sh.shardCollection(&quot;yc.coll2&quot;, {a:&quot;hashed&quot;}); // shard another collection&lt;/li&gt;
	&lt;li&gt;insert some data; db.coll2.insert({a:1}); db.coll2.insert({a:2});db.coll2.insert({a:3})&lt;/li&gt;
	&lt;li&gt;login mongosB&lt;/li&gt;
	&lt;li&gt;db.getMongo().setReadPref(&quot;secondary&quot;)&lt;/li&gt;
	&lt;li&gt;use yc; db.coll2.find({a:1}); db.coll2.find({a:2}); db.coll2.find({a:3}). some documents could not be found&lt;/li&gt;
&lt;/ol&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>
                                    <customfieldvalue><![CDATA[yuan.fang@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i260jz:</customfieldvalue>

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