<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:36:37 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>[CSHARP-370] Setting a node as Hidden doesn&apos;t propagate to C# drivers</title>
                <link>https://jira.mongodb.org/browse/CSHARP-370</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;While running an application, if you set a replica node as hidden before the thread the application is running on exits, the node will still be listed as a viable secondary.&lt;/p&gt;

&lt;p&gt;Steps to reproduce:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Create a MongoDB replica set with at least one server on port 27019&lt;/li&gt;
	&lt;li&gt;Run the code here &lt;a href=&quot;https://gist.github.com/56ca0ad073ed7f2be257&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gist.github.com/56ca0ad073ed7f2be257&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;While the code is running you should see output of the current secondaries it knows about&lt;/li&gt;
	&lt;li&gt;While the code is running still, connect to the primary MongoDB node and run...&lt;/li&gt;
	&lt;li&gt;rs.status()&lt;/li&gt;
	&lt;li&gt;Find a secondary node and take note of its index (I used 1)&lt;/li&gt;
	&lt;li&gt;config = rs.conf()&lt;/li&gt;
	&lt;li&gt;config.members&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;.priority = 0&lt;/li&gt;
	&lt;li&gt;config.members&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;.hidden = true&lt;/li&gt;
	&lt;li&gt;rs.reconfig(config)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This will set member 1 to be now hidden.  However the application can still see it as a viable secondary as seen by the application output.  If you re run the application you will see it&apos;s missing from the list of secondary candidates, as it should be.&lt;/p&gt;

&lt;p&gt;If you were to take the server offline completely while the app is running you&apos;ll see it gets removed from the list of viable secondaries.  You can also call server.Reconnect() and this will update the list correctly.&lt;/p&gt;</description>
                <environment>Windows 7 x64</environment>
        <key id="27109">CSHARP-370</key>
            <summary>Setting a node as Hidden doesn&apos;t propagate to C# drivers</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="chadmoran">Chad Moran</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Dec 2011 01:14:53 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:23 +0000</updated>
                            <resolved>Tue, 20 Mar 2012 04:17:31 +0000</resolved>
                                    <version>1.3.1</version>
                                    <fixVersion>1.4</fixVersion>
                                                        <votes>5</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="100429" author="rstam" created="Tue, 20 Mar 2012 04:17:31 +0000"  >&lt;p&gt;The driver now uses the response to isMaster (from the primary only, that being considered the source of truth) to dynamically detect (without requiring Reconnect to be called) whether members have been added or removed from the replica set.&lt;/p&gt;</comment>
                            <comment id="100428" author="rstam" created="Tue, 20 Mar 2012 04:15:47 +0000"  >&lt;p&gt;The server is supposed to reply to isMaster with &lt;/p&gt;
{ secondary : false }
&lt;p&gt; when a secondary is in recovering mode. That is enough to keep to the driver from sending queries to that secondary.&lt;/p&gt;

&lt;p&gt;If the server is not accurately setting &lt;/p&gt;
{ secondary : false }
&lt;p&gt; then we can either address it at the server level, or if necessary the C# driver could call the replSetGetStatus command to get more detailed information about the member status, but that would require an additional round trip to the server.&lt;/p&gt;</comment>
                            <comment id="75739" author="chadmoran" created="Fri, 23 Dec 2011 19:42:08 +0000"  >&lt;p&gt;Robert, I assume this will also fix nodes that go into/come out of Recovery, also?&lt;/p&gt;</comment>
                            <comment id="75601" author="rstam" created="Fri, 23 Dec 2011 03:51:16 +0000"  >&lt;p&gt;Chad, I agree with that approach.&lt;/p&gt;
</comment>
                            <comment id="75598" author="chadmoran" created="Fri, 23 Dec 2011 03:18:33 +0000"  >&lt;p&gt;I think adding IsHidden and still including it in the list of Secondaries would be best.  Then having it know that it&apos;s hidden and not to send reads to it.&lt;/p&gt;</comment>
                            <comment id="75594" author="rstam" created="Fri, 23 Dec 2011 03:01:10 +0000"  >&lt;p&gt;A similar issue would occur if a replica set member is added or removed while the C# driver is connected to the replica set. The change won&apos;t be noticed until the driver reconnects.&lt;/p&gt;

&lt;p&gt;A related question is whether a hidden replica set member should be included in the set of server instances returned by MongoServer.Instances. If so, we should add an IsHidden property to MongoServerInstance so client code can tell that it&apos;s a hidden replica set member. In other words, is being hidden so absolute that client code can&apos;t even see the member, or is hidden just a behavioral mode that means reads shouldn&apos;t be sent to it.&lt;/p&gt;</comment>
                            <comment id="75305" author="chadmoran" created="Thu, 22 Dec 2011 01:15:58 +0000"  >&lt;p&gt;Note, this was with server 2.0.2 and driver 1.3.1&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="16090">CSHARP-201</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|hrh84f:</customfieldvalue>

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