<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:45: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>[SERVER-37250] Ban use of $out with read preferences other than &quot;primary&quot;</title>
                <link>https://jira.mongodb.org/browse/SERVER-37250</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Aggregations with a $out stage fail when issued to a secondary on a replica set because we do not currently support reading from a primary and writing to a secondary. While this was always the case, with the new $out modes, we are now able to issue a $out to a secondary on a sharded cluster because we use the ClusterWriter. Though this is a nice feature, the behavior is not consistent between replica sets and sharded clusters. To provide consistency, we should ban reading from a secondary when the aggregation contains a $out stage. As connecting to a secondary is almost always achieved by setting readPreference to something other than &quot;primary&quot; (ie. &quot;secondary&quot;, &quot;secondaryPreferred&quot;, &quot;primaryPreferred&quot;, or &quot;nearest&quot;), we should prohibit this combination. We should also clean up the error message issued to the user when they do connect directly with the secondary.&lt;/p&gt;</description>
                <environment></environment>
        <key id="608010">SERVER-37250</key>
            <summary>Ban use of $out with read preferences other than &quot;primary&quot;</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="devin.hilly@mongodb.com">Devin Hilly</assignee>
                                    <reporter username="nicholas.zolnierz@mongodb.com">Nicholas Zolnierz</reporter>
                        <labels>
                    </labels>
                <created>Fri, 21 Sep 2018 13:52:02 +0000</created>
                <updated>Mon, 3 Jun 2019 14:44:42 +0000</updated>
                            <resolved>Tue, 6 Nov 2018 20:39:16 +0000</resolved>
                                                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2053760" author="devin.hilly" created="Tue, 6 Nov 2018 20:39:16 +0000"  >&lt;p&gt;Decided not to fix this. The undesired behavior - honoring readPreference in an aggregation with a $out - would only ever happen if there were a bug in the shell or the driver issuing the aggregation. Though there is such a bug in PyMongo (&lt;a href=&quot;https://jira.mongodb.org/browse/PYTHON-1665&quot; title=&quot;PyMongo should send aggregate commands with $out to primary nodes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PYTHON-1665&quot;&gt;&lt;del&gt;PYTHON-1665&lt;/del&gt;&lt;/a&gt;), fixing the bug in the server was causing more problems than it was addressing. The main issue was that the shell often attaches a default readPreference of &quot;secondaryPreferred&quot; to commands on replica sets (even though for commands like $out it ignores these and runs them on primary). This started making tests fail when we rejected all readPreferences other than &quot;primary,&quot; and fixing this problem seemed difficult.&lt;/p&gt;</comment>
                            <comment id="2046658" author="asya" created="Tue, 30 Oct 2018 19:29:57 +0000"  >&lt;p&gt;We might need to sync up to make sure we agree on what a consistent way to do this is.&lt;/p&gt;

&lt;p&gt;on a replica set, we can simply detect that an aggregate with $out is about to run on a secondary node and fail it with a nice error message.&lt;/p&gt;

&lt;p&gt;however, we cannot do that in a sharded cluster since secondaries won&apos;t see the full pipeline, so the error has to be issued by &lt;tt&gt;mongos&lt;/tt&gt; when it gets an aggregate with $out and readPreference &lt;tt&gt;secondary&lt;/tt&gt; yes?&#160; &#160;Any other read preference can be ignored in favor of routing the aggregation to primaries as any other write command.&lt;/p&gt;

&lt;p&gt;Does that seem correct?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2046626" author="asya" created="Tue, 30 Oct 2018 19:14:03 +0000"  >&lt;p&gt;Note that driver spec already says that drivers should notice when aggregate has &lt;tt&gt;$out&lt;/tt&gt; and direct it to primary regardless of read preference.&#160; However not all drivers seemed to have implemented it.&#160; &#160;The shell &lt;b&gt;does&lt;/b&gt;&#160;implement it.&#160; &#160;Though not for &quot;explain&quot; &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="210923">SERVER-18992</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>3.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 30 Oct 2018 19:14:03 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 14 weeks, 1 day 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-828</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>charlie.swanson@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 14 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>devin.hilly@mongodb.com</customfieldvalue>
            <customfieldvalue>nicholas.zolnierz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu8jrb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htxoan:</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="2533">Query 2018-10-22</customfieldvalue>
    <customfieldvalue id="2534">Query 2018-11-05</customfieldvalue>
    <customfieldvalue id="2535">Query 2018-11-19</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|hu860n:</customfieldvalue>

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