<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52: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>[JAVA-507] Recognize that a removed node is not part of a healthy replica set</title>
                <link>https://jira.mongodb.org/browse/JAVA-507</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Imagine the following scenario:&lt;/p&gt;

&lt;p&gt;1. You have a three-node replica set with members at localhost:30000,&lt;br/&gt;
localhost:30001, and localhost:30002, where the last of these is the&lt;br/&gt;
primary.&lt;/p&gt;

&lt;p&gt;2. The seed list as the driver knows it starts with the node at localhost:30000.&lt;/p&gt;

&lt;p&gt;3. You run rs.remove(&apos;localhost:30000&apos;).&lt;/p&gt;

&lt;p&gt;4. You step down the current primary to force the driver to reconnect.&lt;/p&gt;

&lt;p&gt;In this situation, the Ruby driver would never reconnect. The reason&lt;br/&gt;
is that when the Ruby driver tries to connect, it does the following:&lt;/p&gt;

&lt;p&gt;1. Iterates through the seed list until it can successfully connect to&lt;br/&gt;
a node. In this case, that node was the one we removed&lt;br/&gt;
(&apos;localhost:30000&apos;).&lt;/p&gt;

&lt;p&gt;2. Runs isMaster and verifies that the node has a &apos;hosts&apos; field and&lt;br/&gt;
that it has the expected replica set name.&lt;/p&gt;

&lt;p&gt;3. Iterates through the hosts list attempting to find a primary node.&lt;br/&gt;
In this case, there was just one hosts in the list (&apos;localhost:30000&apos;)&lt;br/&gt;
and it was not a primary node.&lt;/p&gt;

&lt;p&gt;The issue is that the removed node still sees itself as a kind of&lt;br/&gt;
replica set, albeit a crippled one. I&apos;ve created a server ticket to&lt;br/&gt;
address this issue. You&apos;ll see some interesting details here:&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4731&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-4731&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The solution to the problem for now is to recognize&lt;br/&gt;
that a removed node is not part of a healthy replica set. If the node&lt;br/&gt;
specifies just one host and is neither a primary nor a secondary, all&lt;br/&gt;
of which can be deduced from the isMaster command, then you&apos;re safe in&lt;br/&gt;
concluding that an in moving on to the next seed.  More succinctly: &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Number of hosts == 1&lt;/li&gt;
	&lt;li&gt;ismaster == false&lt;/li&gt;
	&lt;li&gt;secondary == false&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="28755">JAVA-507</key>
            <summary>Recognize that a removed node is not part of a healthy replica set</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="jeff.yemin@mongodb.com">Jeffrey Yemin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 20 Jan 2012 18:43:48 +0000</created>
                <updated>Wed, 19 Oct 2016 14:17:27 +0000</updated>
                            <resolved>Sat, 21 Jan 2012 00:48:27 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="81408" author="jeff.yemin" created="Sat, 21 Jan 2012 00:48:27 +0000"  >&lt;p&gt;This is not actually a bug.  The method com.mongodb.ReplicaSetStatus#getASecondary implements an equivalent algorithm.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhbdj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14643</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>