<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:53:47 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-61957] Incorrect check for whether a collection is sharded in cluster_aggregate.cpp</title>
                <link>https://jira.mongodb.org/browse/SERVER-61957</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently cluster_aggregate.cpp&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/21c2ad8764c396fc6afae226bbcea8c780e6bdee/src/mongo/db/pipeline/lite_parsed_pipeline.cpp#L135-L141&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;asserts&lt;/a&gt; that for each involved namesapce, either all of the pipeline stages work with sharded collections or the namespace is not sharded (via&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5704a4c1a964ec083b70f43db5a3b112bd1e2024/src/mongo/s/query/cluster_aggregate.cpp#L250-L256&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt; function that is passed in).&lt;/p&gt;

&lt;p&gt;However, it is not correct for a router to use its routing table cache to check if a collection is sharded, because the cache can be stale: the collection could have been dropped and recreated as unsharded.&lt;/p&gt;

&lt;p&gt;Instead, the router could assume the collection is unsharded and the data node could error if the collection is actually sharded.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1945094">SERVER-61957</key>
            <summary>Incorrect check for whether a collection is sharded in cluster_aggregate.cpp</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="1" iconUrl="https://jira.mongodb.org/images/icons/statuses/open.png" description="">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="esha.maharishi@mongodb.com">Esha Maharishi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2021 15:48:40 +0000</created>
                <updated>Tue, 6 Dec 2022 00:44:32 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="4245386" author="esha.maharishi@10gen.com" created="Mon, 13 Dec 2021 21:42:25 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=steve.la&quot; class=&quot;user-hover&quot; rel=&quot;steve.la&quot;&gt;steve.la&lt;/a&gt;, an example user setup is:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;User creates and shards a collection&lt;/li&gt;
	&lt;li&gt;User drops the collection and recreates it as unsharded&lt;/li&gt;
	&lt;li&gt;User runs a query that uses the collection in a stage not supported on sharded collections and gets back an error.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It does not bring down any node in the cluster, just fails the query.&lt;/p&gt;

&lt;p&gt;It seems like this code is at least 3 years old.&lt;/p&gt;

&lt;p&gt;There is a workaround (the user can call flushRouterConfig against the mongos or restart the mongos, after which mongos will load a fresh list of the sharded collections). I also hope all stages will work with sharded collections within the next one or two years.&lt;/p&gt;

&lt;p&gt;I mainly wanted to raise this because I&apos;ve seen similar bugs a few times (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61333&quot; title=&quot;The check to reject a snapshot read on a sharded collection via the &amp;quot;distinct&amp;quot; command should happen on mongod not mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61333&quot;&gt;&lt;del&gt;SERVER-61333&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42788&quot; title=&quot;For convertToCapped, router should not check if the collection is sharded itself&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42788&quot;&gt;&lt;del&gt;SERVER-42788&lt;/del&gt;&lt;/a&gt;). I see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45186&quot; title=&quot;Checks for sharded collections are racy on mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45186&quot;&gt;SERVER-45186&lt;/a&gt; is a generic ticket about this. It sounds fine to close this ticket, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61333&quot; title=&quot;The check to reject a snapshot read on a sharded collection via the &amp;quot;distinct&amp;quot; command should happen on mongod not mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61333&quot;&gt;&lt;del&gt;SERVER-61333&lt;/del&gt;&lt;/a&gt;, and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42788&quot; title=&quot;For convertToCapped, router should not check if the collection is sharded itself&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42788&quot;&gt;&lt;del&gt;SERVER-42788&lt;/del&gt;&lt;/a&gt; as dupes of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45186&quot; title=&quot;Checks for sharded collections are racy on mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45186&quot;&gt;SERVER-45186&lt;/a&gt; and just prioritize &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45186&quot; title=&quot;Checks for sharded collections are racy on mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45186&quot;&gt;SERVER-45186&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 13 Dec 2021 17:23:08 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 8 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/PM-2144'>PM-2144</a></s>]]></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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 8 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0dnjr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzwy2n:</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="5277">QE 2021-12-27</customfieldvalue>
    <customfieldvalue id="5279">QE 2022-01-10</customfieldvalue>
    <customfieldvalue id="5281">QE 2022-04-04</customfieldvalue>
    <customfieldvalue id="5283">QE 2022-02-07</customfieldvalue>
    <customfieldvalue id="5285">QE 2022-02-21</customfieldvalue>
    <customfieldvalue id="5287">QE 2022-03-07</customfieldvalue>
    <customfieldvalue id="5289">QE 2022-03-21</customfieldvalue>
    <customfieldvalue id="5810">QE 2022-01-24</customfieldvalue>
    <customfieldvalue id="5888">QE 2022-04-18</customfieldvalue>
    <customfieldvalue id="5890">QE 2022-05-02</customfieldvalue>

                        </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|i0d9p3:</customfieldvalue>

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