<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:28:36 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-74816] Unnecessary call to `checkOnPrimaryShardForDb&apos; in `attachCursorToPipeline`</title>
                <link>https://jira.mongodb.org/browse/SERVER-74816</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When the &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; method gets to perform &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 it discovers 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, 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;</description>
                <environment></environment>
        <key id="2287558">SERVER-74816</key>
            <summary>Unnecessary call to `checkOnPrimaryShardForDb&apos; in `attachCursorToPipeline`</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="ivan.fefer@mongodb.com">Ivan Fefer</assignee>
                                    <reporter username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</reporter>
                        <labels>
                            <label>pm3229-m1</label>
                    </labels>
                <created>Tue, 14 Mar 2023 10:23:58 +0000</created>
                <updated>Sun, 29 Oct 2023 21:24:59 +0000</updated>
                            <resolved>Mon, 7 Aug 2023 10:30:25 +0000</resolved>
                                                    <fixVersion>7.1.0-rc0</fixVersion>
                                    <component>Query Execution</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="5616529" author="xgen-internal-githook" created="Mon, 7 Aug 2023 10:24:24 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Ivan Fefer&apos;, &apos;email&apos;: &apos;ivan.fefer@mongodb.com&apos;, &apos;username&apos;: &apos;Fefer-Ivan&apos;}
&lt;p&gt;Message: &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; Use cm to check for db primary and remove checkOnPrimaryShardForDb&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1aa6cc2c2ef07dfd1daefb0c4aea8be382291788&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1aa6cc2c2ef07dfd1daefb0c4aea8be382291788&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5605593" author="david.storch" created="Tue, 1 Aug 2023 17:42:43 +0000"  >&lt;p&gt;I think &lt;tt&gt;MongoProcessInterface::checkOnPrimaryShardForDb()&lt;/tt&gt; should be deleted entirely as part of this ticket.&#160;If I&apos;m not mistaken, the caller mentioned here is actually the &lt;em&gt;only&lt;/em&gt; caller.&lt;/p&gt;</comment>
                            <comment id="5272237" author="JIRAUSER1270811" created="Tue, 14 Mar 2023 18:41:37 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev@mongodb.com&quot;&gt;kaloian.manassiev@mongodb.com&lt;/a&gt;&#160; Is your PR &lt;a href=&quot;https://github.com/10gen/mongo/pull/11215&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo/pull/11215&lt;/a&gt; fixing the same problem as BF-27740 was opened for (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-74380&quot; title=&quot;Router role retry loop should allow namespaces different from the one it was created for&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-74380&quot;&gt;&lt;del&gt;SERVER-74380&lt;/del&gt;&lt;/a&gt;)? That failure happened somewhere under the same lambda function your PR is removing the bad call from.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="2306096">SERVER-75643</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2335549">SERVER-76937</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>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.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_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>Tue, 14 Mar 2023 11:24:11 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        26 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/SERVER-75643'>SERVER-75643</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-76937'>SERVER-76937</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_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_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>
                            26 weeks, 2 days 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>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>ivan.fefer@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>kevin.cherkauer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2019r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1iyi4:</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="6815">Sharding EMEA 2023-03-20</customfieldvalue>
    <customfieldvalue id="6817">Sharding EMEA 2023-04-03</customfieldvalue>
    <customfieldvalue id="6818">Sharding EMEA 2023-04-17</customfieldvalue>
    <customfieldvalue id="7185">Sharding EMEA 2023-05-01</customfieldvalue>
    <customfieldvalue id="7243">QE 2023-08-07</customfieldvalue>
    <customfieldvalue id="7246">QE 2023-08-21</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|i1znf3:</customfieldvalue>

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