<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:24:27 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>[DRIVERS-1992] Set 0 for batchsize for initial change stream</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-1992</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #fafbfc;&quot;&gt;
&lt;h3&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;What is the problem or use case, what are we trying to achieve?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Add option to set independent batch sizes for changestreams. This would be a new option in addition to BatchSize currently on changestream options to set the cursor batchsize on subsquent getMores.&lt;/p&gt;

&lt;p&gt;This will allow us to set the initial aggregate batch size to 0 in the cases where the aggregation takes a large amount of time. We need to be able to set a batch size for the subsequent getMores however, or we will never return anything with a batchSize:0 for both.&lt;/p&gt;

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

&lt;p&gt;the drivers don&#8217;t have a good way to auto-teminate a query&#160;until we have established a cursor, which only happens&#160;after the initial aggregate completes.&#160;&lt;/p&gt;

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

&lt;p&gt;So in a case where we abandon the initial aggregate, or where the client crashes, it just keeps running to completion on the server. If we establish a cursor with&#160;&lt;tt&gt;batchSize:0&lt;/tt&gt;, then when the driver abandons the cursor it will automatically issue an explicit&#160;&lt;tt&gt;killCursors&lt;/tt&gt;&#160;to the server.&lt;/p&gt;

&lt;p&gt;For an example on the go driver, here&apos;s what we implemented on Realm&apos;s forked go driver repo:&#160;&lt;a href=&quot;https://github.com/mongodb-forks/mongo-go-driver/pull/8/files&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb-forks/mongo-go-driver/pull/8/files&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;a name=&quot;Whoistheaffectedenduser%3F&quot;&gt;&lt;/a&gt;Who is the affected end user?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Who are the stakeholders?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Users who use changestreams. In this specific case, users who use Realm triggers and sync.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howdoesthisaffecttheenduser%3F&quot;&gt;&lt;/a&gt;How does this affect the end user?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Are they blocked? Are they annoyed? Are they confused?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ll speak to how end users are impacted in the sense of triggers, but I imagine there&apos;s a larger use case here. For users who have a fairly large oplog with a match expression that is very selective, the trigger will fail while opening up the changestream because we a timeout limit we enforce outside of the driver. We utilize the collection.Watch functionality, which will attempt to open the changestream and return a cursor to us.&#160;&lt;/p&gt;

&lt;p&gt;In the case of a timeout on the initial opening, the driver can&apos;t kill the aggregation because a cursor wasn&apos;t established. So, the trigger will suspend, and the aggregation will continue to run on the user&apos;s cluster. The user can then restart the trigger, causing the above scenario to happen again by kicking off a new aggregation, and ultimately timing out. This is impactful to the user&apos;s cluster because the aggregation will run to completion causing unnecessary resources to be used.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howlikelyisitthatthisproblemorusecasewilloccur%3F&quot;&gt;&lt;/a&gt;How likely is it that this problem or use case will occur?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Main path? Edge case?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;this is an edge case for customers who have very large oplogs.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Iftheproblemdoesoccur%2Cwhataretheconsequencesandhowseverearethey%3F&quot;&gt;&lt;/a&gt;If the problem does occur, what are the consequences and how severe are they?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Minor annoyance at a log message? Performance concern? Outage/unavailability? Failover can&apos;t complete?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Since the driver can&apos;t kill the old operations that were kicked off due to not retrieving a cursor back, the severity largely depends on how many times a changestream is retried and failed. In the triggers case, a user can restart their trigger many times which can lead to a pretty severe consequence.&#160;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisissueurgent%3F&quot;&gt;&lt;/a&gt;Is this issue urgent?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Does this ticket have a required timeline? What is it?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;this isn&apos;t urgent since Realm has made this change in our forked go driver repo.&#160;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketrequiredbyadownstreamteam%3F&quot;&gt;&lt;/a&gt;Is this ticket required by a downstream team?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Needed by e.g. Atlas, Shell, Compass?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Realm&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketonlyfortests%3F&quot;&gt;&lt;/a&gt;Is this ticket only for tests?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Is this ticket have any functional impact, or is it just test improvements?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;this ticket is not only for tests.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="1932311">DRIVERS-1992</key>
            <summary>Set 0 for batchsize for initial change stream</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="boris.dogadov@mongodb.com">Boris Dogadov</assignee>
                                    <reporter username="tim.sedgwick@mongodb.com">Tim Sedgwick</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Nov 2021 18:54:24 +0000</created>
                <updated>Fri, 8 Jul 2022 17:59:00 +0000</updated>
                            <resolved>Fri, 8 Jul 2022 17:59:00 +0000</resolved>
                                                        <component>Change Streams</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="4208396" author="tim.sedgwick" created="Tue, 23 Nov 2021 20:14:41 +0000"  >&lt;p&gt;This is very similar to &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1589&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/DRIVERS-1589&lt;/a&gt;, although this would allow the consumer of the driver be able to set batchSize to other options besides 0 as described in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1589&quot; title=&quot;Allow changing BatchSize for getMores; needed when BatchSize(0) uses default size&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1589&quot;&gt;DRIVERS-1589&lt;/a&gt;.&lt;/p&gt;

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

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1900&quot; title=&quot;Add SetBatchSize method to driver.BatchCursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1900&quot;&gt;&lt;del&gt;GODRIVER-1900&lt;/del&gt;&lt;/a&gt;&#160;works if you want to set the batchSize for both the initial aggregation and the subsequent getMores. &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1900&quot; title=&quot;Add SetBatchSize method to driver.BatchCursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1900&quot;&gt;&lt;del&gt;GODRIVER-1900&lt;/del&gt;&lt;/a&gt;&#160;does not work for the case that you want to independently set this.&#160;&lt;/p&gt;</comment>
                            <comment id="4208352" author="shane.harvey" created="Tue, 23 Nov 2021 19:50:11 +0000"  >&lt;p&gt;This request is very similar to &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1589&quot; title=&quot;Allow changing BatchSize for getMores; needed when BatchSize(0) uses default size&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1589&quot;&gt;DRIVERS-1589&lt;/a&gt; which the Go team has already added support for. Is that problem that &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-1900&quot; title=&quot;Add SetBatchSize method to driver.BatchCursor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-1900&quot;&gt;&lt;del&gt;GODRIVER-1900&lt;/del&gt;&lt;/a&gt; does not work for change stream cursors?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="2023328">CDRIVER-4357</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023330">CSHARP-4137</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023329">CXX-2489</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023331">GODRIVER-2379</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023332">JAVA-4573</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023334">MOTOR-931</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023333">NODE-4183</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023336">PHPLIB-840</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023335">PYTHON-3223</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023337">RUBY-2955</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2023338">RUST-1266</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1636324">DRIVERS-1589</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <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_10951" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Driver Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10748"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_23952" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Driver Compliance</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<style type='text/css'>
         #scriptField, #scriptField *{
                border: 1px solid black;
            }

            #scriptField{
                border-collapse: collapse;
            }

            #scriptField td {
                text-align: center; /* Center-align text in table cells */
            }

            #scriptField td.key {
                text-align: left; /* Left-align text in the Key column */
            }

            #scriptField a {
                text-decoration: none; /* Remove underlines from links */
                border: none; /* Remove border from links */
            }
            
            /* Add green background color to cells with FixVersion */
            #scriptField td.hasFixVersion {
                background-color: #00FF00; /* Green color code */
            }

            /* Center-align the first row headers */
            #scriptField th {
                text-align: center;
            }
        </style>
<table id='scriptField'>
  <tr>
    <th>Key</th>
    <th>Status/Resolution</th>
    <th>FixVersion</th>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-4357'>CDRIVER-4357</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CXX-2489'>CXX-2489</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-4137'>CSHARP-4137</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/GODRIVER-2379'>GODRIVER-2379</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-4573'>JAVA-4573</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/NODE-4183'>NODE-4183</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/MOTOR-931'>MOTOR-931</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-3223'>PYTHON-3223</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPLIB-840'>PHPLIB-840</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-2955'>RUBY-2955</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUST-1266'>RUST-1266</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/SWIFT-1544'>SWIFT-1544</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
</table>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY23Q3</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr1pjw:6</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>