<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:31:06 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-13244] Secondary that enters RECOVERY mode does not reset connections</title>
                <link>https://jira.mongodb.org/browse/SERVER-13244</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When a node changes state normally (most notably from an election) it disconnects all sockets partly to ensure the change of state is noticed. However, when a Secondary enters RECOVERY mode due to a compact command, it does not close existing sockets.&lt;/p&gt;

&lt;p&gt;Clients using secondaryPreferred continue to utilize the node as a normal secondary (operations either get blocked or return a failure due to &quot;not primary or secondary&quot;) but new clients do not attempt to issue queries because the invalid state is detected.&lt;/p&gt;

&lt;p&gt;If the change in state means that normal client operations cannot proceed, the sockets should be reset, as is the case for elections.&lt;/p&gt;</description>
                <environment></environment>
        <key id="122009">SERVER-13244</key>
            <summary>Secondary that enters RECOVERY mode does not reset connections</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="1" iconUrl="https://jira.mongodb.org/images/icons/statuses/open.png" description="">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-server-repl">Backlog - Replication Team</assignee>
                                    <reporter username="andrew.ryder@mongodb.com">Andrew Ryder</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Mar 2014 04:07:51 +0000</created>
                <updated>Tue, 6 Dec 2022 05:09:05 +0000</updated>
                                                            <fixVersion>Needs Further Definition</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="541753" author="andrew.ryder@10gen.com" created="Wed, 9 Apr 2014 05:19:09 +0000"  >&lt;ol&gt;
	&lt;li&gt;When a server transitions from PRIMARY to SECONDARY, future &lt;b&gt;write&lt;/b&gt; commands will fail.&lt;/li&gt;
	&lt;li&gt;When a server transitions from SECONDARY to RECOVERING, future &lt;b&gt;read&lt;/b&gt; commands will fail.&lt;/li&gt;
&lt;/ol&gt;


&lt;blockquote&gt;&lt;p&gt;The reason for primary to non-primary connection dropping is because of writes (just think about the wire protocol), which is a special case and fairly important.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The wire protocol has no concept of node states.&lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;insert&lt;/tt&gt; command is grammatically identical to the &lt;tt&gt;getLastError&lt;/tt&gt; command, and is encoded into BSON the same way. One of these is write-only. The other is read-only. The wire protocol cannot tell the difference. The availability of these commands is determined by the state of the instance one is connected to - nothing to do with the wire protocol.&lt;/p&gt;

&lt;p&gt;I do not see what is special about writing that does not apply to reading. The impairment of either function is of equal importance. A database that cannot be written is useless. A database that cannot be read is useless.&lt;/p&gt;

&lt;p&gt;But why not simply an error message for both conditions then? Why an error message for one, and abrupt disconnection for another?&lt;/p&gt;</comment>
                            <comment id="521536" author="scotthernandez" created="Mon, 24 Mar 2014 12:59:35 +0000"  >&lt;p&gt;Drivers/clients do periodically pull/check the state of each node, and should react when the server responds with not-master/slave-ok. The reason for primary to non-primary connection dropping is because of writes (just think about the wire protocol), which is a special case and fairly important.&lt;/p&gt;

&lt;p&gt;It is not a general rule to drop connection on state changes, no &amp;#8211; making it so would dramatically change client/system behavior.&lt;/p&gt;</comment>
                            <comment id="521443" author="andrew.ryder@10gen.com" created="Mon, 24 Mar 2014 05:19:33 +0000"  >&lt;p&gt;I agree the behavior could be addressed at the driver, but that doesn&apos;t really address my question.&lt;/p&gt;

&lt;p&gt;I want to clarify:&lt;br/&gt;
&lt;b&gt;Do drivers need to actively monitor for state changes or not?&lt;/b&gt;&lt;br/&gt;
If yes, then why disconnect existing clients on PRIMARY / SECONDARY transitions?&lt;br/&gt;
If no, then why &lt;em&gt;not&lt;/em&gt; disconnect existing clients on &lt;em&gt;other&lt;/em&gt; state changes that affect the outcome?&lt;/p&gt;

&lt;p&gt;I am inquiring as to what is special about the PRIMARY / SECONDARY transition such that it warrants dropping existing connections but which does not apply to other state changes.&lt;/p&gt;

&lt;p&gt;If the behavior to &quot;drop all connections&quot; when changing between SECONDARY and PRIMARY conditions is for a different reason (that is, if the change in state is incidental to the rationale behind terminating all connections) then the retention of connections through the transition to RECOVERING state can be justified as having no special significance. Right now, the SECONDARY / PRIMARY transition highlights a connection retention rule that does not appear to be consistently applied.&lt;/p&gt;

&lt;p&gt;Is there a rule being applied that I do not understand?&lt;/p&gt;</comment>
                            <comment id="518462" author="milkie" created="Tue, 18 Mar 2014 16:58:35 +0000"  >&lt;p&gt;Is there a specific driver you had in mind for this behavior?  I&apos;m not sure that a blanket statement that all clients using secondaryPreferred would indefinitely produce errors when a particular node in a set is in state RECOVERING is accurate.  In general, I believe this is an issue that can improved at the driver level, if it isn&apos;t already optimal.  After receiving one error, it&apos;s certainly possible for the client to rescan the state of the replica set and avoid sending further read requests to a RECOVERING node.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25128"><![CDATA[Replication]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 18 Mar 2014 16:58:35 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 45 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/CS-11283'>CS-11283</a></s>]]></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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 45 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>andrew.ryder@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-repl</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlypb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrwtr3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>105550</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_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|hsh27r:</customfieldvalue>

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