<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:56 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>[GODRIVER-777] Does the Go Driver cache DNS and if so how long?</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-777</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;I am using Consul for service discovery with a MongoDB replica set. In Consul, I have an address for a primary node (e.g. mongo-primary.service.consul). To connect, I use the following connection string:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongodb:&lt;/span&gt;&lt;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;//&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;@mongo-primary.service.consul:27017/feed?replicaSet=rs&amp;amp;connect=direct&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;1.) Is this a safe way to connect to my replica set? Does the Go driver cache DNS connections? Is there a way for me to configure the cache TTL?&lt;/p&gt;

&lt;p&gt;2.) Is there a way for me to connect this way without the option connect=direct? Is that expected when connecting directly to the primary?&lt;/p&gt;</description>
                <environment></environment>
        <key id="675661">GODRIVER-777</key>
            <summary>Does the Go Driver cache DNS and if so how long?</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="3">Duplicate</resolution>
                                        <assignee username="david.golden@mongodb.com">David Golden</assignee>
                                    <reporter username="wesp">Wesley Porter</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jan 2019 20:25:25 +0000</created>
                <updated>Wed, 11 Sep 2019 18:35:56 +0000</updated>
                            <resolved>Fri, 1 Mar 2019 19:28:55 +0000</resolved>
                                                                    <component>Options &amp;amp; Configuration</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2167800" author="david.golden" created="Fri, 1 Mar 2019 19:28:40 +0000"  >&lt;p&gt;To clarify my comment: Consul follows the technical details of RFC-2782, but expands the definition of service and protocol.  In RFC-2782, a &quot;service&quot; is described as a singular &quot;well-known&quot; name, such as &quot;ldap&quot; or &quot;imap&quot; from &lt;tt&gt;/etc/services&lt;/tt&gt; and a &quot;protocol&quot; is a symbolic IP protocol name.  However, Consul allows (mandates?) the use of custom service names (&quot;my-mongo&quot; in your case) and allows tags in place of protocols.  The current design of the mongodb+srv scheme conforms narrowly to the definitions of RFC-2782, with a &quot;well-known&quot; service name of &quot;mongodb&quot; and the TCP protocol.&lt;/p&gt;

&lt;p&gt;I&apos;ll close this as a duplicate.&lt;/p&gt;</comment>
                            <comment id="2167750" author="wesp" created="Fri, 1 Mar 2019 19:02:08 +0000"  >&lt;p&gt;Hi David,&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thank you for the reply! Consul&apos;s way of doing things does follow RFC 2782. &lt;a href=&quot;https://www.consul.io/docs/agent/dns.html#rfc-2782-lookup&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.consul.io/docs/agent/dns.html#rfc-2782-lookup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;It looks like this ticket is a duplicate then of &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-521&quot; title=&quot;Allow custom service names with srvServiceName URI option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-521&quot;&gt;DRIVERS-521&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2167681" author="david.golden" created="Fri, 1 Mar 2019 18:13:52 +0000"  >&lt;p&gt;Hi.  This issue has come up before in &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-521&quot; title=&quot;Allow custom service names with srvServiceName URI option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-521&quot;&gt;DRIVERS-521&lt;/a&gt;.  Our current design is strict against the RFC and doesn&apos;t currently allow custom service names.  Please consider following that ticket for any updates.&lt;/p&gt;

&lt;p&gt;In the mean time, our recommendation is to use different domain names for different MongoDB clusters rather than different service names.&lt;/p&gt;</comment>
                            <comment id="2156212" author="pjt" created="Tue, 19 Feb 2019 20:58:03 +0000"  >&lt;p&gt;Hi Jeff, we&apos;re trying to use the &quot;mongodb+srv&quot; syntax, but we&apos;re running into a problem. Consul does support DNS SRV records, but it looks like the driver is trying to a &quot;RFC 2782 Lookup&quot; which isn&apos;t working. For example, I can do&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;dig my-mongo.service.consul SRV&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;and it finds all of the nodes with the correct port. But when I try connecting to mongo with&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongodb+srv:&lt;/span&gt;&lt;span style=&quot;color: #008200; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;//&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;@xm-feed-mongo.service.consul/?replicaSet=rs&amp;amp;ssl=false&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;it fails because it can&apos;t find &quot;_mongodb._tcp.my-mongo.service.consul&quot;. It looks like &lt;a href=&quot;#rfc-2782-lookup&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;consul DOES support these type of lookups&lt;/a&gt;&#160;but it needs the address to be something like &quot;_my-mongo._tcp.service.consul&quot;. Is there a way to either stop the driver from adding the &quot;_mongodb._tcp&quot; prefix to the address? If not, is there a way to customize the service name in the prefix?&lt;/p&gt;</comment>
                            <comment id="2130564" author="jeff.yemin" created="Tue, 29 Jan 2019 15:12:48 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=wesp&quot; class=&quot;user-hover&quot; rel=&quot;wesp&quot;&gt;wesp&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Generally the correct way to connect to a replica set is to use specify a connection string that:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Includes more than one member.  That way if one of the members is down for maintenance, the driver can still connect to one of the others&lt;/li&gt;
	&lt;li&gt;Specifies the replica set name.  You did this already.  It&apos;s not required, but it&apos;s a good sanity check&lt;/li&gt;
	&lt;li&gt;Does not include &lt;tt&gt;connect=direct&lt;/tt&gt;.  That option should only be used in special circumstances, usually when you want to perform some administrative operation on a specific server.  Given the way replica sets work, it&apos;s better to let the driver discover which server is the primary rather than making an assumption about which member is primary.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I&apos;m not too familiar with Consul, so that may place additional constraints on what you&apos;re trying to accomplish.  If Consul allows you to maintain DNS SRV records, you can use the driver&apos;s support for the &lt;tt&gt;mongodb+srv&lt;/tt&gt; connection string protocol.  See&lt;a href=&quot;https://www.mongodb.com/blog/post/mongodb-3-6-here-to-SRV-you-with-easier-replica-set-connections&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this blog post&lt;/a&gt; for a description.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="568322">DRIVERS-521</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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu9rxz:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>