<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:28 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-2517] Aggregation on sharded cluster fails when $gleStats is used as a cursor option</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2517</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;In &lt;a href=&quot;https://jira.mongodb.org/browse/PHPC-1128&quot; title=&quot;Aggregation pipelines are broken on sharded collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPC-1128&quot;&gt;&lt;del&gt;PHPC-1128&lt;/del&gt;&lt;/a&gt;, a user reported seeing the following error when attempting to run an aggregation pipeline on a sharded cluster:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Cannot use $-modifiers in opts: &quot;$gleStats&quot;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I traced this error to &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.2/src/mongoc/mongoc-cursor.c#L267&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;_mongoc_cursor_new_with_opts()&lt;/tt&gt;&lt;/a&gt;, called by &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.2/src/mongoc/mongoc-cursor.c#L2223&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;mongoc_cursor_new_from_command_reply()&lt;/tt&gt;&lt;/a&gt;, which &lt;a href=&quot;https://github.com/mongodb/mongo-php-driver/blob/1.4.1/php_phongo.c#L897&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;we call when constructing the cursor for a command response&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This error does not appear in versions of the PHP driver before 1.4.0 (libmongoc 1.9.2), so I believe it originated with &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/25ee1193b5e343eea9edd32c4016101aec9a0961&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;25ee119&lt;/a&gt; for &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2348&quot; title=&quot;New API for setting awaitData and tailable on command cursors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2348&quot;&gt;&lt;del&gt;CDRIVER-2348&lt;/del&gt;&lt;/a&gt;. In earlier versions of libmongoc, the only the cursor ID and reply array were considered in the command response. Since that commit, other fields are now incorporated as cursor options.&lt;/p&gt;

&lt;p&gt;Since the logic in &lt;tt&gt;mongoc_cursor_new_from_command_reply()&lt;/tt&gt; &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.2/src/mongoc/mongoc-cursor.c#L2234&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;does exclude certain fields&lt;/a&gt; before copying the reply document into a new BSON document for cursor options, I wonder if it should be enhanced to ignore all $-prefixed fields (which would trigger the same error in &lt;tt&gt;_mongoc_cursor_new_with_opts()&lt;/tt&gt;), or at least &lt;tt&gt;$gleStats&lt;/tt&gt; (as it does &lt;tt&gt;$clusterTime&lt;/tt&gt;).&lt;/p&gt;

&lt;p&gt;There isn&apos;t much documentation on the &lt;tt&gt;$gleStats&lt;/tt&gt; available, but &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-20265&quot; title=&quot;Config servers need to always include $gleStats in their command responses if they are primary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-20265&quot;&gt;&lt;del&gt;SERVER-20265&lt;/del&gt;&lt;/a&gt; does hint at its purpose as a sharding-specific field.&lt;/p&gt;</description>
                <environment>mongod/mongos 3.4.9</environment>
        <key id="501105">CDRIVER-2517</key>
            <summary>Aggregation on sharded cluster fails when $gleStats is used as a cursor option</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="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Feb 2018 15:35:23 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:05 +0000</updated>
                            <resolved>Mon, 26 Feb 2018 19:52:37 +0000</resolved>
                                    <version>1.9.0</version>
                                    <fixVersion>1.9.3</fixVersion>
                    <fixVersion>1.10.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1821406" author="xgen-internal-githook" created="Fri, 2 Mar 2018 17:39:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2517&quot; title=&quot;Aggregation on sharded cluster fails when $gleStats is used as a cursor option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2517&quot;&gt;&lt;del&gt;CDRIVER-2517&lt;/del&gt;&lt;/a&gt; ignore $gleStats creating cursor from command reply&lt;br/&gt;
Branch: debian&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/5602c585b231ddcc317930528c5331da749c9f38&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/5602c585b231ddcc317930528c5331da749c9f38&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1821401" author="xgen-internal-githook" created="Fri, 2 Mar 2018 17:38:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2517&quot; title=&quot;Aggregation on sharded cluster fails when $gleStats is used as a cursor option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2517&quot;&gt;&lt;del&gt;CDRIVER-2517&lt;/del&gt;&lt;/a&gt; ignore $gleStats creating cursor from command reply&lt;br/&gt;
Branch: r1.9-dfsg&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/5602c585b231ddcc317930528c5331da749c9f38&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/5602c585b231ddcc317930528c5331da749c9f38&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1816387" author="xgen-internal-githook" created="Mon, 26 Feb 2018 19:52:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2517&quot; title=&quot;Aggregation on sharded cluster fails when $gleStats is used as a cursor option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2517&quot;&gt;&lt;del&gt;CDRIVER-2517&lt;/del&gt;&lt;/a&gt; ignore $gleStats creating cursor from command reply&lt;br/&gt;
Branch: r1.9&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/5602c585b231ddcc317930528c5331da749c9f38&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/5602c585b231ddcc317930528c5331da749c9f38&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1816383" author="xgen-internal-githook" created="Mon, 26 Feb 2018 19:49:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2517&quot; title=&quot;Aggregation on sharded cluster fails when $gleStats is used as a cursor option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2517&quot;&gt;&lt;del&gt;CDRIVER-2517&lt;/del&gt;&lt;/a&gt; ignore $gleStats creating cursor from command reply&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e56ab17f888852cd4c94fdcdfca284f443d02c60&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e56ab17f888852cd4c94fdcdfca284f443d02c60&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="501067">PHPC-1128</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="501287">CDRIVER-2518</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="455915">CDRIVER-2348</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|htics7:</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>