<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:22: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-823] Support $merge and $out executing on secondaries</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-823</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;h2&gt;&lt;a name=&quot;DescriptionofLinkedTicket&quot;&gt;&lt;/a&gt;Description of Linked Ticket&lt;/h2&gt;
    &lt;div class=&quot;panel&quot; style=&quot;background-color: #c2d2c2;border-color: #ccc;border-style: dashed;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-style: dashed;border-bottom-color: #ccc;background-color: #239eb0;&quot;&gt;&lt;b&gt;Epic Summary&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #c2d2c2;&quot;&gt;
&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;


&lt;h4&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;Motivation&lt;/h4&gt;


&lt;h4&gt;&lt;a name=&quot;CastofCharacters&quot;&gt;&lt;/a&gt;Cast of Characters&lt;/h4&gt;
&lt;ul&gt;
	&lt;li&gt;Product Owner: Katya Kamenieva&lt;/li&gt;
	&lt;li&gt;Project Lead: David Storch&lt;/li&gt;
	&lt;li&gt;Program Manager: Craig Homa.&lt;/li&gt;
&lt;/ul&gt;



&lt;h4&gt;&lt;a name=&quot;Documentation&quot;&gt;&lt;/a&gt;Documentation&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;http://tinyurl.com/waopcy6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Server Scope Document&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://tinyurl.com/usa57hd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Server Technical Design Document&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://tinyurl.com/u4l4slz&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Driver Scope Document&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://mongodb.slack.com/archives/C02ELB2DT1D&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Slack channel: #drivers-823-out-merge-on-secondaries&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="1128616">DRIVERS-823</key>
            <summary>Support $merge and $out executing on secondaries</summary>
                <type id="11" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14707&amp;avatarType=issuetype">Epic</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="13453" iconUrl="https://jira.mongodb.org/images/icons/status_generic.gif" description="">Implementing</status>
                    <statusCategory id="4" key="indeterminate" colorName="inprogress"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="backlog-server-pm">Backlog - Core Eng Program Management Team</reporter>
                        <labels>
                            <label>big-rock</label>
                    </labels>
                <created>Tue, 4 Feb 2020 15:43:34 +0000</created>
                <updated>Mon, 21 Aug 2023 20:11:47 +0000</updated>
                                                                <component>CRUD</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="4136018" author="jmikola@gmail.com" created="Wed, 20 Oct 2021 17:48:58 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1958&quot; title=&quot;aggregate-write-readPreference tests should not expect readConcern to be passed to pre-4.2 servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1958&quot;&gt;DRIVERS-1958&lt;/a&gt; made a correction to the spec tests for this issue. Although &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1958&quot; title=&quot;aggregate-write-readPreference tests should not expect readConcern to be passed to pre-4.2 servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1958&quot;&gt;DRIVERS-1958&lt;/a&gt; has its own language tickets, I&apos;ve amended the downstream changes for &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-823&quot; title=&quot;Support $merge and $out executing on secondaries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-823&quot;&gt;DRIVERS-823&lt;/a&gt; to refer to &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1958&quot; title=&quot;aggregate-write-readPreference tests should not expect readConcern to be passed to pre-4.2 servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1958&quot;&gt;DRIVERS-1958&lt;/a&gt; and suggest that drivers do both tickets together.&lt;/p&gt;</comment>
                            <comment id="4090690" author="xgen-internal-githook" created="Tue, 28 Sep 2021 22:39:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeremy Mikola&apos;, &apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-823&quot; title=&quot;Support $merge and $out executing on secondaries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-823&quot;&gt;DRIVERS-823&lt;/a&gt;: Support $out and $merge on secondaries (#1062)&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Fix grammar and indentation for may-use-secondary commands&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Delete obsolete $out aggregation pipeline operator spec&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Fix RST warnings in CRUD spec&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-823&quot; title=&quot;Support $merge and $out executing on secondaries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-823&quot;&gt;DRIVERS-823&lt;/a&gt;: Support $out and $merge on secondaries&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Suggest clarifying documentation for $merge output cursors&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Clarify setting SecondaryOk/$readPreference for replica sets&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Consolidate $out/$merge tests and add tests for db-aggregate&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Drivers SHOULD use single selection attempt, but MAY use a second&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;mongos cannot combine db-aggregate stages with $out or $merge&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Clarify concept of an effective read preference&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Co-authored-by: Kevin Albertson &amp;lt;kevin.albertson@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/specifications/commit/5f8f6689538a39a36186285e747d3ac2fbcb27d1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/commit/5f8f6689538a39a36186285e747d3ac2fbcb27d1&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1211773">DOCS-13479</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="787956">DRIVERS-868</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="1612690">PHPLIB-651</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1612689">PYTHON-2554</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1612691">RUBY-2526</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1913549">DRIVERS-1969</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1901722">DRIVERS-1956</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1903378">DRIVERS-1958</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_13653" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Detailed Project Statuses</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Lead: Jeremy&lt;/p&gt;

&lt;p&gt;Summary: Allow an aggregation with a $merge or $out stage to respect the user-specified read preference rather than unconditionally using read preference primary.&lt;/p&gt;

&lt;p&gt;2021-09-22:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Spec PR close to getting wrapped up&lt;/li&gt;
	&lt;li&gt;Go and PHP implementations in code review&lt;/li&gt;
&lt;/ul&gt;


&lt;hr /&gt;</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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;As of MongoDB 5.0, drivers can support read preferences (either explicit/per-operation or inherited) for aggregations including an $out/$merge stage. Previously, such pipelines would always require a primary.&lt;/p&gt;

&lt;p&gt;Drivers should sync unified CRUD tests to &lt;a href=&quot;https://github.com/mongodb/specifications/commit/5f8f6689538a39a36186285e747d3ac2fbcb27d1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/specifications@5f8f668&lt;/a&gt;. If possible, drivers may consider implementing &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1958&quot; title=&quot;aggregate-write-readPreference tests should not expect readConcern to be passed to pre-4.2 servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1958&quot;&gt;DRIVERS-1958&lt;/a&gt; alongside this ticket and sync to &lt;a href=&quot;https://github.com/mongodb/specifications/commit/dce2c48e697e9a7d08faad871e86b415bb481df7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/specifications@dce2c48&lt;/a&gt;, which fixes an issue with the original spec tests for &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-823&quot; title=&quot;Support $merge and $out executing on secondaries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-823&quot;&gt;DRIVERS-823&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The outdated &quot;$out Aggregation Pipeline Operator&quot; specification was also deleted. All relevant information for $out/$merge is now discussed in the CRUD spec (and parts of Server Selection).&lt;/p&gt;

&lt;p&gt;Note: &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1969&quot; title=&quot;Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1969&quot;&gt;&lt;del&gt;DRIVERS-1969&lt;/del&gt;&lt;/a&gt; revises behavior for applying a read preference. Drivers that have yet to implement &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-823&quot; title=&quot;Support $merge and $out executing on secondaries&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-823&quot;&gt;DRIVERS-823&lt;/a&gt; should consider that ticket when picking up this work. &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1969&quot; title=&quot;Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1969&quot;&gt;&lt;del&gt;DRIVERS-1969&lt;/del&gt;&lt;/a&gt; does &lt;em&gt;not&lt;/em&gt; change any spec tests.&lt;/p&gt;</customfieldvalue>

                        </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/RUBY-2526'>RUBY-2526</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.17.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-2554'>PYTHON-2554</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>4.1</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUST-663'>RUST-663</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/GODRIVER-1868'>GODRIVER-1868</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>1.8.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-3994'>JAVA-3994</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>4.4.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CXX-2184'>CXX-2184</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>3.8.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/MOTOR-666'>MOTOR-666</a>
    </td>
    <td>Duplicate</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-3893'>CDRIVER-3893</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>1.21.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/SWIFT-1105'>SWIFT-1105</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/NODE-3083'>NODE-3083</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>4.2.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-3397'>CSHARP-3397</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>2.15.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPLIB-651'>PHPLIB-651</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.10.0</td>
  </tr>
</table>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10860" key="com.pyxis.greenhopper.jira:gh-epic-color">
                        <customfieldname>Epic Colour</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ghx-label-6</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10858" key="com.pyxis.greenhopper.jira:gh-epic-label">
                        <customfieldname>Epic Name</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>$merge and $out on secondaries</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10859" key="com.pyxis.greenhopper.jira:gh-epic-status">
                        <customfieldname>Epic Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10640"><![CDATA[To Do]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY22Q3</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr47v3:</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_11150" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>SERVER fixVersion</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16441"><![CDATA[4.4]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_22279" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Server Compat</customfieldname>
                        <customfieldvalues>
                                        <label>4.4</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_14261" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 28 Sep 2021 00:00:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_21457" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Upstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;If an $out or $merge aggregate operation is delivered to a secondary node, and the operation has non-primary read preference, the operation will now work as expected. In previous versions, the operation would fail with a NotMaster category error. However, drivers have chosen not to add explicit support for this feature in their 4.4-compatible releases. There may be a way in some drivers to access this feature using a lower-level API. However, since the drivers are not changing to respect non-primary read preference for $out/$merge operations in 4.4, there should be no immediate downstream impact.&lt;/p&gt;</customfieldvalue>

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