<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:02:53 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>[DOCS-11469] Ambiguity about Where the Merge Sort Occurs in a Sharded Cluster</title>
                <link>https://jira.mongodb.org/browse/DOCS-11469</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;The documentation states, in different places, that a merge sort occurs on the mongos, or on the Primary database of the collection. The documentation may need to be reconciled, or, if I&apos;m misunderstanding what&apos;s being communicated, clarified.&lt;/p&gt;

&lt;p&gt;I believe that the mongos is the only shard that merge-sorts the results of a .find() query.&lt;/p&gt;

&lt;p&gt;Statements in favor of each:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://docs.mongodb.org/manual/core/sharded-cluster-query-router/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the primary shard&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;&quot;If the query specifies sorted results using the sort() cursor method, the mongos instance passes the $orderby option to the shards. The primary shard for the database receives and performs a merge sort for all results before returning the data to the client via the mongos.&quot;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://docs.mongodb.org/manual/faq/sharding/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the mongos&lt;/a&gt;
	&lt;ul&gt;
		&lt;li&gt;&quot;If you call the cursor.sort() method on a query in a sharded environment, the mongod for each shard will sort its results, and the mongos merges each shard&#8217;s results before returning them to the client.&quot;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I also note that the explanation references the $orderby option, which, according to the documentation, is &lt;a href=&quot;https://docs.mongodb.org/manual/reference/operator/meta/orderby/#metaOp._S_orderby&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;deprecated as of 3.2&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="514224">DOCS-11469</key>
            <summary>Ambiguity about Where the Merge Sort Occurs in a Sharded Cluster</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="andrew.feierabend@mongodb.com">Andrew Feierabend</assignee>
                                    <reporter username="ravind.kumar">Ravind Kumar</reporter>
                        <labels>
                    </labels>
                <created>Tue, 20 Mar 2018 23:02:51 +0000</created>
                <updated>Sun, 29 Oct 2023 13:58:10 +0000</updated>
                            <resolved>Tue, 2 Mar 2021 21:54:35 +0000</resolved>
                                                                        <due></due>
                            <votes>1</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="4483700" author="JIRAUSER1257477" created="Thu, 14 Apr 2022 16:21:51 +0000"  >&lt;p&gt;&lt;em&gt;Fix Version updated for upstream &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17737&quot; title=&quot;Support distributed merger for aggregation queries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17737&quot;&gt;SERVER-17737&lt;/a&gt;:&lt;/em&gt; &lt;/p&gt;</comment>
                            <comment id="3220346" author="kay.kim@10gen.com" created="Tue, 23 Jun 2020 18:50:20 +0000"  >&lt;p&gt;Commits per Asya&apos;s &lt;a href=&quot;https://github.com/mongodb/docs/pull/4168&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;pull request&lt;/a&gt; :&lt;/p&gt;

&lt;p&gt;Branch: master&lt;br/&gt;
 &lt;a href=&quot;https://github.com/mongodb/docs/commit/5c0d94f91db602edd57e688c45b8425546ba1a9e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/5c0d94f91db602edd57e688c45b8425546ba1a9e&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Branch: v4.2&lt;br/&gt;
 &lt;a href=&quot;https://github.com/mongodb/docs/commit/ce4f8c163e88bd9287186fb8f0d500b2b2ffdb23&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/ce4f8c163e88bd9287186fb8f0d500b2b2ffdb23&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Branch: v4.0&lt;br/&gt;
 &lt;a href=&quot;https://github.com/mongodb/docs/commit/5c0d94f91db602edd57e688c45b8425546ba1a9e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/5c0d94f91db602edd57e688c45b8425546ba1a9e&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Branch: v3.6&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/docs/commit/6c8d275ae82e7a9428ada0ef073e2e4ec608fbbb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/6c8d275ae82e7a9428ada0ef073e2e4ec608fbbb&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2060743" author="xgen-internal-githook" created="Tue, 13 Nov 2018 21:17:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;ravind&apos;, &apos;email&apos;: &apos;ravind.kumar@10gen.com&apos;, &apos;username&apos;: &apos;rkumar-mongo&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-11469&quot; title=&quot;Ambiguity about Where the Merge Sort Occurs in a Sharded Cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-11469&quot;&gt;&lt;del&gt;DOCS-11469&lt;/del&gt;&lt;/a&gt;: Removing paragraph, future work to provide better clarification on topic&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/e44023c29055205252699581d294760345c5af8a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/e44023c29055205252699581d294760345c5af8a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2060741" author="xgen-internal-githook" created="Tue, 13 Nov 2018 21:15:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;ravind&apos;, &apos;email&apos;: &apos;ravind.kumar@10gen.com&apos;, &apos;username&apos;: &apos;rkumar-mongo&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-11469&quot; title=&quot;Ambiguity about Where the Merge Sort Occurs in a Sharded Cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-11469&quot;&gt;&lt;del&gt;DOCS-11469&lt;/del&gt;&lt;/a&gt;: Removing paragraph, future work to provide better clarification on topic&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/aac36434e758ae665f56a071bf8e86ebbd65cb51&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/aac36434e758ae665f56a071bf8e86ebbd65cb51&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2060735" author="xgen-internal-githook" created="Tue, 13 Nov 2018 21:12:15 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;ravind&apos;, &apos;email&apos;: &apos;ravind.kumar@10gen.com&apos;, &apos;username&apos;: &apos;rkumar-mongo&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-11469&quot; title=&quot;Ambiguity about Where the Merge Sort Occurs in a Sharded Cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-11469&quot;&gt;&lt;del&gt;DOCS-11469&lt;/del&gt;&lt;/a&gt;: Removing paragraph, future work to provide better clarification on topic&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/f7c29fa6f6a9e22753de36302654b1fabf2be608&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/f7c29fa6f6a9e22753de36302654b1fabf2be608&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2060729" author="ravind.kumar" created="Tue, 13 Nov 2018 21:10:28 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/docs/pull/3485&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/pull/3485&lt;/a&gt;&#160;&amp;lt;- For the short term, I&apos;m removing the paragraph until we&apos;ve fully reviewed the information as provided by &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bernard.gorman&quot; class=&quot;user-hover&quot; rel=&quot;bernard.gorman&quot;&gt;bernard.gorman&lt;/a&gt; . At that point we can create clear and concise documentation describing merge sort behavior.&lt;/p&gt;</comment>
                            <comment id="2020738" author="ravind.kumar" created="Tue, 2 Oct 2018 15:53:35 +0000"  >&lt;p&gt;If you have bandwidth to handle next week, that would be ideal. If not, I&apos;ll find someone to handle.&lt;/p&gt;</comment>
                            <comment id="2020698" author="sue.kerschbaumer" created="Tue, 2 Oct 2018 15:40:54 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ravind.kumar&quot; class=&quot;user-hover&quot; rel=&quot;ravind.kumar&quot;&gt;ravind.kumar&lt;/a&gt; I somehow missed this ticket&#160;&#8211; I&apos;m wondering if someone in server would be able to pick this up now? I could revisit next week if not.&lt;/p&gt;</comment>
                            <comment id="1840330" author="ravind.kumar" created="Tue, 20 Mar 2018 23:05:53 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sue.kerschbaumer&quot; class=&quot;user-hover&quot; rel=&quot;sue.kerschbaumer&quot;&gt;sue.kerschbaumer&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;So the original work on &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7237&quot; title=&quot;Ambiguity about Where the Merge Sort Occurs in a Sharded Cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-7237&quot;&gt;&lt;del&gt;DOCS-7237&lt;/del&gt;&lt;/a&gt; captured most of the changes required to correct the ambiguity, but there are two remaining sections that still need corrections:&lt;/p&gt;

&lt;p&gt;1) &lt;a href=&quot;https://docs.mongodb.com/manual/core/sharded-cluster-query-router/#sorting&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/core/sharded-cluster-query-router/#sorting&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Via &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-7237?focusedCommentId=1317466&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1317466&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;David&apos;s commentary&lt;/a&gt;, the merge sort &lt;em&gt;always&lt;/em&gt; occurs on the &lt;tt&gt;mongos&lt;/tt&gt; for &lt;tt&gt;find&lt;/tt&gt; operations. For aggregation operations, the merge-sort occurs on a random shard.&lt;/p&gt;

&lt;p&gt;2) &lt;a href=&quot;https://docs.mongodb.com/manual/core/sharded-cluster-query-router/#routing-and-results-process&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/core/sharded-cluster-query-router/#routing-and-results-process&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This paragraph also references the primary shard as responsible for merge sorting.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                            <outwardlinks description="documents">
                                        <issuelink>
            <issuekey id="191967">SERVER-17737</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1005011">DOCS-13229</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="308297">DOCS-8582</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>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 11 Apr 2018 23:58:20 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 42 weeks, 6 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_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>
                            1 year, 42 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.feierabend@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jess.mokrzecki@mongodb.com</customfieldvalue>
            <customfieldvalue>kay.kim@mongodb.com</customfieldvalue>
            <customfieldvalue>ravind.kumar</customfieldvalue>
            <customfieldvalue>sue.kerschbaumer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htt5hr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htkgrr:</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_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htsrp3:</customfieldvalue>

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