<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:06: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-44603] Consider having tailable readPreference &quot;primary&quot; queries killed on stepdown</title>
                <link>https://jira.mongodb.org/browse/SERVER-44603</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Queries with an explicit &lt;tt&gt;readPreference: &quot;primary&quot;&lt;/tt&gt; are currently allowed to survive stepdown. This behavior is reasonable when the results are bounded. I.e: some results were returned and the remaining results from a &lt;tt&gt;getmore&lt;/tt&gt; are just as consistent as if the node were still a primary. &lt;/p&gt;

&lt;p&gt;However for clients tailing a capped collection (e.g: the oplog), there is no longer a way to guarantee between the driver and server that once a query is opened against a primary, that the node continues to be primary. Applications that desire this guarantee must implement something on their end such as periodically re-issuing the query, or having some side-channel monitoring the replica set state.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1000782">SERVER-44603</key>
            <summary>Consider having tailable readPreference &quot;primary&quot; queries killed on stepdown</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="alan.zheng@mongodb.com">Alan Zheng</assignee>
                                    <reporter username="daniel.gottlieb@mongodb.com">Daniel Gottlieb</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Nov 2019 15:53:59 +0000</created>
                <updated>Thu, 7 Apr 2022 21:40:01 +0000</updated>
                                            <version>4.2.0</version>
                    <version>4.3.1</version>
                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>25</watches>
                                                                                                                <comments>
                            <comment id="3331691" author="bernard.gorman" created="Mon, 10 Aug 2020 22:01:54 +0000"  >&lt;p&gt;I agree with the original ticket description re: the distinction between a bounded regular query and a tailable cursor, and I can see a fair case that users would desire different behaviour for each. However, I think Arnie is correct that there are also plenty of occasions where a user would prefer a long-running regular query to stay off the new Primary if a node steps up during election, or conversely where they might want the query to migrate to the new Primary on stepdown. But we obviously can&apos;t revert to something like the old 4.0 &amp;#40;?&amp;#41; behaviour where we kill all queries on stepdown, as that would be far too disruptive to anything that isn&apos;t a change stream (though PM-915 may eliminate this difference to a large extent).&lt;/p&gt;

&lt;p&gt;Since this seems like a case where deciding on the most desirable behaviour is a toss-up and is as likely to annoy customers as to help them, why not give them the option to choose the appropriate behaviour?&lt;/p&gt;

&lt;p&gt;What if we were to introduce a new parameter in the &lt;tt&gt;readPreference&lt;/tt&gt; spec, something like {&lt;tt&gt;strict: &amp;lt;boolean&amp;gt;&lt;/tt&gt;} or, more explicitly, {&lt;tt&gt;reassessAfterElection: &amp;lt;boolean&amp;gt;&lt;/tt&gt;}? This would default to &apos;false&apos; to maintain the current behaviour, but if the client sets it to &apos;true&apos; then we would revalidate the read preference each time we check out a cursor. That way, a &lt;tt&gt;find&lt;/tt&gt;, &lt;tt&gt;aggregate&lt;/tt&gt; or &lt;tt&gt;getMore&lt;/tt&gt; which is running during an election would be allowed to complete, but the following &lt;tt&gt;getMore&lt;/tt&gt; will throw &lt;tt&gt;InterruptedDueToReplStateChange&lt;/tt&gt; if the node&apos;s new role no longer satisfies the read preference. Any operations which are resumable would then be re-targeted to the appropriate post-election nodes and re-issued.&lt;/p&gt;

&lt;p&gt;That way, customers could choose (on a per-operation basis) whether they want to prioritise cross-election query survival OR keeping workloads on/off particular nodes. The current behaviour would be maintained by default and would therefore not be a Versioned API violation, and the change would be relatively simple - we would not have to build new machinery to proactively seek out and kill operations every time there&apos;s an election.&lt;/p&gt;</comment>
                            <comment id="2983507" author="schwerin" created="Tue, 17 Mar 2020 16:52:48 +0000"  >&lt;p&gt;oplog tailing aside, I think the current behavior is correct. For the changestream and oplog tailing case, I&apos;m less certain, because those queries are logically moving through time. I&apos;m still not thrilled with hanging up on stepdown for queries that don&apos;t have a clear route to resumption (not restart), but maybe for collections where resumption is possible (oplog/changestream) this change or a similar one could make sense.&lt;/p&gt;</comment>
                            <comment id="2538989" author="daniel.gottlieb@10gen.com" created="Wed, 13 Nov 2019 16:01:17 +0000"  >&lt;p&gt;Alternatively, it may be worthwhile to update the &lt;a href=&quot;https://docs.mongodb.com/manual/core/read-preference/#read-preference-modes&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Default mode. All operations read from the current replica set primary.&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="240090">SERVER-21537</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1277707">DOCS-13520</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="698884">SERVER-39621</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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000pDcOIQA0]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 18 Nov 2019 19:22:19 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 26 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_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>elizabeth.roytburd@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 26 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alan.zheng@mongodb.com</customfieldvalue>
            <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>bernard.gorman@mongodb.com</customfieldvalue>
            <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hw2f6f:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvqpsn:</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_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|hw21fr:</customfieldvalue>

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