<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:41:20 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-79580] Remove HostTypeRequirement::kPrimaryShard from $lookup</title>
                <link>https://jira.mongodb.org/browse/SERVER-79580</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;ul&gt;
	&lt;li&gt;Just remove the kPrimaryShard requirement and use kNone, since $lookup knows how to find the data wherever it may be placed. However, when all the data is on a single shard, we should move the $lookup to the merging part of the pipeline and have a way to target this specific shard.&lt;/li&gt;
	&lt;li&gt;Extend distributedPlanLogic() so that it can name the id of the shard that should be targeted for the merging pipeline. Alternatively we could introduce a host type requirement like kOwningShardPreferred as suggested by Bernard and require the caller to figure out which shard this corresponds to. My vote is for the former alternative.&lt;/li&gt;
	&lt;li&gt;Plumb the ShardId up from the pipeline splitting code so that it can make its way to dispatchMergingPipeline()&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There are quite a few scenarios we need to test in order to validate that $lookup works as expected. We may want to split the testing work into a few separate commits.&lt;/p&gt;

&lt;p&gt;Tests:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Inner collection is unsharded and not on the primary shard. Outer collection is sharded.&lt;/li&gt;
	&lt;li&gt;Outer collection is unsharded and not on the primary shard. Inner collection is sharded.&lt;/li&gt;
	&lt;li&gt;Neither collection is sharded, but both are collocated on the same shard. Test that we can do SBE $lookup pushdown in this case.&lt;/li&gt;
	&lt;li&gt;Neither collection is sharded and they are located on different shards.&lt;br/&gt;
A &lt;span class=&quot;error&quot;&gt;&amp;#91;$lookup(A), $lookup(B)&amp;#93;&lt;/span&gt; pipeline where both A and B are unsharded but reside on different shards.&lt;/li&gt;
	&lt;li&gt;A &lt;span class=&quot;error&quot;&gt;&amp;#91;$lookup(A), $lookup(B)&amp;#93;&lt;/span&gt; pipeline where A is sharded. B is unsharded but does not reside on the primary shard.&lt;/li&gt;
	&lt;li&gt;A &lt;span class=&quot;error&quot;&gt;&amp;#91;$lookup(A), $lookup(B)&amp;#93;&lt;/span&gt; pipeline where A is unsharded but does not reside on the primary shard. B is sharded.&lt;/li&gt;
	&lt;li&gt;Nested case where we have [$lookup(A, &lt;span class=&quot;error&quot;&gt;&amp;#91;$lookup(B)&amp;#93;&lt;/span&gt;)]. A and B are unsharded and on different shards.&lt;/li&gt;
	&lt;li&gt;Nested case where we have [$lookup(A, &lt;span class=&quot;error&quot;&gt;&amp;#91;$lookup(B)&amp;#93;&lt;/span&gt;)]. A sharded, B unsharded and not on the primary shard.&lt;/li&gt;
	&lt;li&gt;Nested case where we have [$lookup(A, &lt;span class=&quot;error&quot;&gt;&amp;#91;$lookup(B)&amp;#93;&lt;/span&gt;)]. A unsharded and not on the primary shard, B sharded.&lt;/li&gt;
	&lt;li&gt;Should we also test three levels of nesting or is that overkill?&lt;/li&gt;
	&lt;li&gt;moveCollection() on the outer (unsharded) collection during execution. The moveCollection() can only commit during a yield and when the query restores from yield, it should be fail with a QueryPlanKilled error.&lt;/li&gt;
	&lt;li&gt;moveCollection() on the inner (unsharded) collection during execution. As we execute, new sub-queries we should start targeting the inner collection&#8217;s new owner. The subquery on the inner side may also fail with QueryPlanKilled if it detects a moveCollection() happened during yield recovery.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="2406423">SERVER-79580</key>
            <summary>Remove HostTypeRequirement::kPrimaryShard from $lookup</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="13201">Fixed</resolution>
                                        <assignee username="mihai.andrei@mongodb.com">Mihai Andrei</assignee>
                                    <reporter username="david.storch@mongodb.com">David Storch</reporter>
                        <labels>
                            <label>auto-reverted</label>
                            <label>pm3229-m1</label>
                    </labels>
                <created>Tue, 1 Aug 2023 18:03:55 +0000</created>
                <updated>Tue, 12 Dec 2023 15:46:56 +0000</updated>
                            <resolved>Tue, 12 Dec 2023 15:46:56 +0000</resolved>
                                                    <fixVersion>7.3.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5942796" author="xgen-internal-githook" created="Tue, 12 Dec 2023 02:26:40 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Mihai Andrei&apos;, &apos;email&apos;: &apos;mihai.andrei@mongodb.com&apos;, &apos;username&apos;: &apos;mtandrei&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79580&quot; title=&quot;Remove HostTypeRequirement::kPrimaryShard from $lookup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79580&quot;&gt;&lt;del&gt;SERVER-79580&lt;/del&gt;&lt;/a&gt; Add more $lookup targeting tests and support StageConstraints::mergeShardId in $facet&lt;/p&gt;

&lt;p&gt;GitOrigin-RevId: 622d5428b61aaa7fe33ea9ae53ab1432b7a582c8&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1b9fb9111c43d58a6884ef6f853ef9ff63231c63&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1b9fb9111c43d58a6884ef6f853ef9ff63231c63&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5910643" author="xgen-internal-githook" created="Tue, 28 Nov 2023 21:31:53 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Mihai Andrei&apos;, &apos;email&apos;: &apos;mihai.andrei@mongodb.com&apos;, &apos;username&apos;: &apos;mtandrei&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79580&quot; title=&quot;Remove HostTypeRequirement::kPrimaryShard from $lookup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79580&quot;&gt;&lt;del&gt;SERVER-79580&lt;/del&gt;&lt;/a&gt; Remove HostTypeRequirement::kPrimaryShard from $lookup and add basic test coverage&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2a960bb98fc1f05fbb27662af4452845b79294fa&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2a960bb98fc1f05fbb27662af4452845b79294fa&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5907734" author="xgen-internal-githook" created="Tue, 28 Nov 2023 00:36:57 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;auto-revert-processor&apos;, &apos;email&apos;: &apos;dev-prod-dag@mongodb.com&apos;, &apos;username&apos;: &apos;&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79580&quot; title=&quot;Remove HostTypeRequirement::kPrimaryShard from $lookup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79580&quot;&gt;&lt;del&gt;SERVER-79580&lt;/del&gt;&lt;/a&gt; Remove HostTypeRequirement::kPrimaryShard from $lookup and add basic test coverage&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 3d67df1b60f447fddf5ebbf6ac219d2fbcf6029c.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b22d630a1209035ca1025884174cdb83846a4983&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b22d630a1209035ca1025884174cdb83846a4983&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5907102" author="mihai.andrei" created="Mon, 27 Nov 2023 20:36:17 +0000"  >&lt;p&gt;Moving it back to open as there&apos;s one more planned PR for this ticket&lt;/p&gt;</comment>
                            <comment id="5906970" author="xgen-internal-githook" created="Mon, 27 Nov 2023 19:55:04 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Mihai Andrei&apos;, &apos;email&apos;: &apos;mihai.andrei@mongodb.com&apos;, &apos;username&apos;: &apos;mtandrei&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79580&quot; title=&quot;Remove HostTypeRequirement::kPrimaryShard from $lookup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79580&quot;&gt;&lt;del&gt;SERVER-79580&lt;/del&gt;&lt;/a&gt; Remove HostTypeRequirement::kPrimaryShard from $lookup and add basic test coverage&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3d67df1b60f447fddf5ebbf6ac219d2fbcf6029c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3d67df1b60f447fddf5ebbf6ac219d2fbcf6029c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5885886" author="xgen-internal-githook" created="Thu, 16 Nov 2023 17:17:14 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Mihai Andrei&apos;, &apos;email&apos;: &apos;mihai.andrei@mongodb.com&apos;, &apos;username&apos;: &apos;mtandrei&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79580&quot; title=&quot;Remove HostTypeRequirement::kPrimaryShard from $lookup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79580&quot;&gt;&lt;del&gt;SERVER-79580&lt;/del&gt;&lt;/a&gt; Delete remaining references to &apos;featureFlagUnsplittableCollectionsOnNonPrimaryShard&apos;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d7f7dba29a6dd86aaf2fc9db773665820481c11d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d7f7dba29a6dd86aaf2fc9db773665820481c11d&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2448811">SERVER-81335</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2406429">SERVER-79581</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>6.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="25125"><![CDATA[Query Execution]]></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 Nov 2023 20:23:15 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        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[]]></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>mihai.andrei@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>157.0</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>mihai.andrei@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2kexb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1ed6n:i</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_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="7254">QE 2023-10-16</customfieldvalue>
    <customfieldvalue id="7255">QE 2023-10-30</customfieldvalue>
    <customfieldvalue id="7257">QE 2023-11-13</customfieldvalue>
    <customfieldvalue id="7259">QE 2023-11-27</customfieldvalue>
    <customfieldvalue id="7261">QE 2023-12-11</customfieldvalue>
    <customfieldvalue id="7264">QE 2023-12-25</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|i2k12n:</customfieldvalue>

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