<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:34:03 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-76937] Investigate failing $unionWith tests when `checkOnPrimaryShardForDb` is removed</title>
                <link>https://jira.mongodb.org/browse/SERVER-76937</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The code in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cb3823dfebb24e2bcd5bf85b9f6cf0bf05a42e59/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1659&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;attachCursorToPipeline&lt;/tt&gt;&lt;/a&gt; performs &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cb3823dfebb24e2bcd5bf85b9f6cf0bf05a42e59/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1633&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;routing&lt;/a&gt; and when it thinks that the collection is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cb3823dfebb24e2bcd5bf85b9f6cf0bf05a42e59/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1640&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;UNSHARDED&lt;/a&gt;, it will attempt to take the optimised path, establishing cursors locally, though DBDirectClient, instead of making a remote call.&lt;/p&gt;

&lt;p&gt;In order to do this, it &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cb3823dfebb24e2bcd5bf85b9f6cf0bf05a42e59/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1655-L1657&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sets&lt;/a&gt; the expected state of the collection correctly on the OpCtx, and then makes a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cb3823dfebb24e2bcd5bf85b9f6cf0bf05a42e59/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1669&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;call&lt;/a&gt;, which eventually will enter in the shard role. Since this call will already ensure that the cursors are established on the right shard, by virtue of entering the shard role and the checks that this involves (namely db primary and shard version), it is unnecessary (and wrong by itself) to call &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cb3823dfebb24e2bcd5bf85b9f6cf0bf05a42e59/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1659&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;checkOnPrimaryShardForDb&lt;/tt&gt;&lt;/a&gt;, because that check can be invalid as soon as that function returns.&lt;/p&gt;

&lt;p&gt;When &lt;a href=&quot;https://github.com/mongodb/mongo/blob/53cdeb55770a686b3ff4f09ed95176d54b9064d7/src/mongo/db/pipeline/sharded_agg_helpers.cpp#L1632-L1633&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this line&lt;/a&gt; is removed, however, there are &lt;a href=&quot;https://spruce.mongodb.com/version/644807bd7742aed7415511f5/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;failures in some $unionWith tests&lt;/a&gt;, which indicates that there are places where query doesn&apos;t correctly perform shard version checking.&lt;/p&gt;

&lt;p&gt;The goal of this ticket is to investigate and fix the respective query bugs as a prerequisite for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-74816&quot; title=&quot;Unnecessary call to `checkOnPrimaryShardForDb&amp;#39; in `attachCursorToPipeline`&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-74816&quot;&gt;&lt;del&gt;SERVER-74816&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2335549">SERVER-76937</key>
            <summary>Investigate failing $unionWith tests when `checkOnPrimaryShardForDb` is removed</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="13203">Gone away</resolution>
                                        <assignee username="ivan.fefer@mongodb.com">Ivan Fefer</assignee>
                                    <reporter username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</reporter>
                        <labels>
                            <label>pm3229-m1</label>
                    </labels>
                <created>Tue, 9 May 2023 08:57:06 +0000</created>
                <updated>Fri, 27 Oct 2023 20:44:46 +0000</updated>
                            <resolved>Wed, 2 Aug 2023 11:49:25 +0000</resolved>
                                                                    <component>Query Execution</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5607085" author="JIRAUSER1270969" created="Wed, 2 Aug 2023 11:49:13 +0000"  >&lt;p&gt;After investigation, we concluded that db primary check is currently required in this place, so I am going to close this ticket and re-open the dependent one.&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2287558">SERVER-74816</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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>1.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 2 Aug 2023 11:49:13 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        27 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-3229</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>
                            27 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>ivan.fefer@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i28ac7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1qkk8:</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="7243">QE 2023-08-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|i27whj:</customfieldvalue>

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