<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:04:50 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>[SERVER-23923] Agg $out writeConcern not enforced when batchSize=0</title>
                <link>https://jira.mongodb.org/browse/SERVER-23923</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;&apos;s work to have writeConcern handled at the command processor won&apos;t work correctly with $out if the aggregate command returns a cursor with batchSize=0 because the writes are done in the getmore, not in the aggregate command&lt;/p&gt;</description>
                <environment></environment>
        <key id="282337">SERVER-23923</key>
            <summary>Agg $out writeConcern not enforced when batchSize=0</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="9">Done</resolution>
                                        <assignee username="charlie.swanson@mongodb.com">Charlie Swanson</assignee>
                                    <reporter username="mathias@mongodb.com">Mathias Stearn</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Apr 2016 23:32:08 +0000</created>
                <updated>Wed, 5 Jun 2019 20:14:31 +0000</updated>
                            <resolved>Mon, 3 Jun 2019 14:56:53 +0000</resolved>
                                                    <fixVersion>4.1.14</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="2268604" author="xgen-internal-githook" created="Mon, 3 Jun 2019 14:54:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Charlie Swanson&apos;, &apos;email&apos;: &apos;charlie.swanson@mongodb.com&apos;, &apos;username&apos;: &apos;cswanson310&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-23923&quot; title=&quot;Agg $out writeConcern not enforced when batchSize=0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-23923&quot;&gt;&lt;del&gt;SERVER-23923&lt;/del&gt;&lt;/a&gt; Track writeConcern through getMores&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9bcb318c4c9f2c482413a9d85b7e7c99c0492653&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9bcb318c4c9f2c482413a9d85b7e7c99c0492653&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2256552" author="tess.avitabile" created="Wed, 22 May 2019 17:13:34 +0000"  >&lt;p&gt;That sounds reasonable to me. And in the CR, I requested an error check that will help us notice if we change getMore to accept a writeConcern (and then silently ignore it, since we override it using the one from the cursor).&lt;/p&gt;</comment>
                            <comment id="2256117" author="charlie.swanson" created="Wed, 22 May 2019 13:57:11 +0000"  >&lt;p&gt;&quot;never&quot; seems a little strong for my liking but here&apos;s my argument: &lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;It is consistent with other options like readConcern and maxTimeMS: it is specified to the initial cursor-generating command and then applied to subsequent batches implicitly.&lt;/li&gt;
	&lt;li&gt;We don&apos;t have to think about the case where the writeConcern changes in the middle of iterating the cursor. If one getMore has a different writeConcern than the previous one.&lt;/li&gt;
	&lt;li&gt;It seems less complicated for drivers? Shooting in the dark here but it seems simpler to me on the surface.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It is interesting here that our cursor-generating write commands don&apos;t actually return anything ($out and $merge), so it&apos;s a little weird to think about. When reasoning about this in the abstract I&apos;m imagining something like a cursor-style findAndModify with multi: true. In that case I think it would make sense to apply the writeConcern at the level of the command/operation, and not on each getMore. I think for the same reason each batch in an unordered bulk op needs to wait for write concern (I recall it being because there could be rollback of writes from a previous batch before you get to the end), we&apos;d need to wait for writeConcern on each getMore. By this reasoning it&apos;s not crazy to specify a writeConcern to each getMore, but it seems more error-prone without any utility.&lt;/p&gt;

&lt;p&gt;Who else has opinions here? &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=schwerin&quot; class=&quot;user-hover&quot; rel=&quot;schwerin&quot;&gt;schwerin&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="2256065" author="tess.avitabile" created="Wed, 22 May 2019 13:28:15 +0000"  >&lt;p&gt;If we are going with option 2, then I want to check that we are committed to never supporting writeConcern for getMore.&lt;/p&gt;</comment>
                            <comment id="1459041" author="david.storch" created="Thu, 15 Dec 2016 16:45:16 +0000"  >&lt;p&gt;The drivers team plans to ensure that &lt;tt&gt;$out&lt;/tt&gt; with a batchSize of 0 is disallowed, so we are not planning to do any server-side work on this issue at the moment. I&apos;ve tried to summarize our discussion around this issue below.&lt;/p&gt;

&lt;p&gt;It seems that we have two options, each with pros and cons:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Make the getMore command accept a writeConcern.&lt;/li&gt;
	&lt;li&gt;When an aggregation cursor is established, attach the writeConcern to the cursor and apply it on subsequent getMores.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Option #1 has a more natural implementation in the server, since it makes getMore no different from other commands which write. Option #2 would require us to have special writeConcern handling in the getMore path, which could result in duplicated logic to maintain. Option #1 also means that the exposed user interface is more flexible, since a client could in theory specify a different write concern for the initial agg command and the getMore. On the other hand, drivers might not have a natural way to expose this flexibility to the application, and, even if they wanted to do so, this could involve a lot of driver-side development work.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="786423">SERVER-41444</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 15 Dec 2016 16:45:16 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 36 weeks, 2 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1396</customfieldvalue>
                        </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>jmikola@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 36 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrk99b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr7hkv:</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_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1389">Query 2016-12-12</customfieldvalue>
    <customfieldvalue id="2843">Query 2019-06-03</customfieldvalue>
    <customfieldvalue id="2844">Query 2019-06-17</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_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrjcin:</customfieldvalue>

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