<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:39 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-722] Provide a method to inspect the state of a cluster</title>
                <link>https://jira.mongodb.org/browse/CSHARP-722</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Currently, there isn&apos;t a friendly way to get an up-to-date state of a cluster (single server, replica set, shards).  We need to provide a strongly-typed method that will invoke the appropriate server commands and aggregate the results back in an easy to use object model.&lt;/p&gt;</description>
                <environment></environment>
        <key id="71237">CSHARP-722</key>
            <summary>Provide a method to inspect the state of a cluster</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="-1">Unassigned</assignee>
                                    <reporter username="craig.wilson@mongodb.com">Craig Wilson</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Apr 2013 15:53:44 +0000</created>
                <updated>Mon, 18 Aug 2014 14:01:08 +0000</updated>
                            <resolved>Mon, 18 Aug 2014 14:01:07 +0000</resolved>
                                    <version>1.8</version>
                                    <fixVersion>2.0</fixVersion>
                                    <component>API</component>
                    <component>Connectivity</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="340589" author="rstam" created="Tue, 21 May 2013 14:16:45 +0000"  >&lt;p&gt;There already are properties to inspect the state of the cluster, though there are some issues to consider (see below).&lt;/p&gt;

&lt;p&gt;The MongoServer class represents the cluster, and has the following properties and methods that expose information about the cluster:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Arbiters: list of arbiter nodes&lt;/li&gt;
	&lt;li&gt;BuildInfo: version information (taken from the primary)&lt;/li&gt;
	&lt;li&gt;Instances: list of all nodes&lt;/li&gt;
	&lt;li&gt;Passives: list of passive nodes&lt;/li&gt;
	&lt;li&gt;Primary: the current primary node&lt;/li&gt;
	&lt;li&gt;ReplicaSetName: the name of the replica set&lt;/li&gt;
	&lt;li&gt;Secondaries: list of secondary nodes&lt;/li&gt;
	&lt;li&gt;State: overall state of the cluster (Connected, etc...)&lt;/li&gt;
	&lt;li&gt;VerifyState: refresh the state of the cluster by polling all nodes&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The MongoServerInstance class represents a node in the cluster, and has the following properties and methods that expose information about the node:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;InstanceType: the type of node&lt;/li&gt;
	&lt;li&gt;Address: the IP address&lt;/li&gt;
	&lt;li&gt;BuildInfo: version information&lt;/li&gt;
	&lt;li&gt;IsArbiter: true if the node is an arbiter&lt;/li&gt;
	&lt;li&gt;IsMasterResult: the result of the last isMaster command&lt;/li&gt;
	&lt;li&gt;IsPassive: true if the node is passive&lt;/li&gt;
	&lt;li&gt;IsPrimary: true if the node is primary&lt;/li&gt;
	&lt;li&gt;IsSecondary: true if the node is secondary&lt;/li&gt;
	&lt;li&gt;MaxDocumentSize: max document size supported by this node&lt;/li&gt;
	&lt;li&gt;MaxMessageLength: max message length supported by this node&lt;/li&gt;
	&lt;li&gt;State: state of the node (Connected, etc...)&lt;/li&gt;
	&lt;li&gt;VerifyState: refresh the state of the node by polling it&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The main issue to consider is that this information is all cached. This is both good and bad. The good part is that it is essentially free to query these properties because there is no round trip to the server. The bad part is that it can be slightly out of date. The driver refreshes this information every 10 seconds. You can also call VerifyState yourself if you want the information to be as current as possible (taking into account that VerifyState requires round trips to the nodes).&lt;/p&gt;

&lt;p&gt;Another issue is that there is a bug in VerifyState: if you call VerifyState when the cluster is disconnected it does nothing, so as a work around you currently have to call Connect first to ensure the cluster is in a Connected state before you call VerifyState.&lt;/p&gt;

&lt;p&gt;The final issue is that there are some properties of nodes that are not yet exposed. That can be rectified by adding them.&lt;/p&gt;

&lt;p&gt;In hindsight I wish the MongoServer and MongoServerInstance classes where called MongoCluster and MongoNode, as those names would be clearer. Perhaps in version 2.0 we can rectify that, although it would be a breaking change. It also would have been better if VerifyState had been named RefreshState to emphasize that it refreshes the cached information.&lt;/p&gt;

&lt;p&gt;This JIRA ticket proposes an alternative way of getting information about the cluster which doesn&apos;t use cached information, so it would always incur the expense of a round trip to one or more servers.&lt;/p&gt;

&lt;p&gt;Another consideration is that as of version 2.4 of the server the replSetGetStatus command requires clusterAdmin privilege, so &lt;b&gt;if&lt;/b&gt; the proposed helper method was implemented using replSetGetStatus it couldn&apos;t be called by ordinary applications that don&apos;t have clusterAdmin privilege.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="71610">CSHARP-724</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CSHARP-936</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrf9xj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1472</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="243">C# Sprint 6</customfieldvalue>

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