<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:17:31 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-3251] Do not send an extra getMore when resuming if aggregate returns an empty batch</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3251</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;When resuming change stream, we call &lt;tt&gt;mongoc_cursor_next&lt;/tt&gt; on the cursor we create with the aggregate command. But if the aggregate returned an empty batch, we &lt;tt&gt;mongoc_cursor_next&lt;/tt&gt; will send another getMore command (but we should just return NULL in that case).&lt;/p&gt;</description>
                <environment></environment>
        <key id="860686">CDRIVER-3251</key>
            <summary>Do not send an extra getMore when resuming if aggregate returns an empty batch</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="13202">Works as Designed</resolution>
                                        <assignee username="samantha.ritter@mongodb.com">Samantha Ritter</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                    </labels>
                <created>Thu, 18 Jul 2019 15:21:40 +0000</created>
                <updated>Fri, 27 Oct 2023 13:14:11 +0000</updated>
                            <resolved>Mon, 23 Sep 2019 20:08:48 +0000</resolved>
                                                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2429065" author="jmikola@gmail.com" created="Mon, 23 Sep 2019 21:19:07 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=samantha.ritter&quot; class=&quot;user-hover&quot; rel=&quot;samantha.ritter&quot;&gt;samantha.ritter&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jeff.yemin&quot; class=&quot;user-hover&quot; rel=&quot;jeff.yemin&quot;&gt;jeff.yemin&lt;/a&gt;: IIRC, this issue relates somewhat to &lt;a href=&quot;https://jira.mongodb.org/browse/PHPLIB-451&quot; title=&quot;Rewinding change stream cursor should never execute a getMore command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPLIB-451&quot;&gt;&lt;del&gt;PHPLIB-451&lt;/del&gt;&lt;/a&gt;. I think the scenario common to both&lt;br/&gt;
C and PHPLIB is that we want to advance to the first result within the batch (if any) after either the initial aggregate or a resuming aggregate, without ever sending a superfluous getMore command. To address that, I tracked whether aggregate returned an empty firstBatch or not to decide if it was safe to call &lt;tt&gt;mongoc_cursor_next()&lt;/tt&gt; without the risk of triggering a getMore.&lt;/p&gt;

&lt;p&gt;What portion of the spec mandates an &quot;extra&quot; getMore and prohibits the above?&lt;/p&gt;</comment>
                            <comment id="2428950" author="samantha.ritter@10gen.com" created="Mon, 23 Sep 2019 20:08:48 +0000"  >&lt;p&gt;The spec tests for change streams mandate that we send this &quot;extra&quot; getMore after the aggregation.&#160; For some drivers&apos; cursor implementations, where calling next() on the cursor may loop and wait for documents to become available, this makes more sense.&#160; For the C driver, the &quot;extra&quot; getMore right after a successful aggregation that returns an empty batch feels a bit superfluous, but it is spec-defined behavior.&#160; Closing this ticket &quot;Works as Designed.&quot;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </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|hv40af:</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>