<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:16:38 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>[CDRIVER-2886] Aggregate command must be sent to a primary if it uses $out</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2886</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;See &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-582&quot; title=&quot;Aggregate command must be sent to a primary if it uses $out&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-582&quot;&gt;&lt;del&gt;DRIVERS-582&lt;/del&gt;&lt;/a&gt; for details.&lt;/p&gt;</description>
                <environment></environment>
        <key id="634744">CDRIVER-2886</key>
            <summary>Aggregate command must be sent to a primary if it uses $out</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="clyde.bazile@mongodb.com">Clyde Bazile III</assignee>
                                    <reporter username="rathi.gnanasekaran">Rathi Gnanasekaran</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Nov 2018 20:57:38 +0000</created>
                <updated>Sat, 28 Oct 2023 11:29:30 +0000</updated>
                            <resolved>Fri, 8 Mar 2019 18:25:52 +0000</resolved>
                                                    <fixVersion>1.15.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2176077" author="xgen-internal-githook" created="Fri, 8 Mar 2019 18:23:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;bazile-clyde&apos;, &apos;email&apos;: &apos;34226620+bazile-clyde@users.noreply.github.com&apos;, &apos;username&apos;: &apos;bazile-clyde&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2886&quot; title=&quot;Aggregate command must be sent to a primary if it uses $out&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2886&quot;&gt;&lt;del&gt;CDRIVER-2886&lt;/del&gt;&lt;/a&gt; Agg cmd must be sent to a primary if it uses $out&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/46899fa9bb71633cb50cb0d05a8038d4e776fbbd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/46899fa9bb71633cb50cb0d05a8038d4e776fbbd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2166314" author="kevin.albertson" created="Thu, 28 Feb 2019 16:21:08 +0000"  >&lt;p&gt;&lt;tt&gt;mongoc_collection_aggregate&lt;/tt&gt; is lazy. It won&apos;t actually send the aggregate command to the server until the returned cursor is iterated on the first time with &lt;tt&gt;mongoc_cursor_next&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;We select the server to run the initial aggregate command inside our cursor logic here:&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/master/src/libmongoc/src/mongoc/mongoc-cursor.c#L641-L676&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/blob/master/src/libmongoc/src/mongoc/mongoc-cursor.c#L641-L676&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We likely need to indicate on the &lt;tt&gt;mongoc_cursor_t&lt;/tt&gt; (perhaps with a boolean flag) that we need to use a primary. And then set that boolean flag in &lt;tt&gt;mongoc_cursor_aggregate&lt;/tt&gt; if the pipeline has a $out stage.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="634742">CXX-1696</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="626807">DRIVERS-582</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu376v:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>